import java.awt.*;
public class TestPoint7 {
   public static void main (String[] args) {
      
      DrawingPanel panel = new DrawingPanel(400, 400);
      Graphics g = panel.getGraphics();
      int scale = 10;
   
      /* Point and rotation */
      PointIG pA = new PointIG(10, 0, g, scale);   
      System.out.println(pA);
      pA.draw(Color.BLACK);   
      
      PointIG axis1 = new PointIG(10, 10, g, scale);
      System.out.println(axis1);
      axis1.draw(Color.MAGENTA);
      g.drawString("axis for point", scale*axis1.getX(), scale*(axis1.getY() -1));
   
      // Point A
      for (int i = 0; i < 20; i++) {      
         pA.rotate(12, axis1);
         pA.draw(Color.RED);
         //Wait.milliSec(50);
      }
      System.out.println();
   
      /* Triangle and rotation */
      PointIG p1 = new PointIG(27, 5, g, scale);   
      PointIG p2 = new PointIG(19, 11, g, scale); 
      PointIG p3 = new PointIG(29, 12, g, scale); 
      
      // Point 1
      System.out.println(p1);
      p1.draw(Color.BLACK);
      
      // Point 2
      System.out.println(p2);
      p2.draw();
      
      // Point 3
      System.out.println(p3);
      p3.draw(); 
   
      p1.drawLine(p2, Color.BLACK);
      p2.drawLine(p3);
      p3.drawLine(p1);
      
      
      // Axis   
      PointIG axis = new PointIG(2, 30, g, scale); 
      System.out.println(axis);
      axis.draw(Color.BLUE);
      g.drawString("axis for triangle", scale*axis.getX(), scale*(axis.getY() -1));
    
   
      int rotation = 12;
      
      for (int i = 0; i < 10; i+=3){
      
      
      
      // Point 1
         p1.rotate(rotation, axis);
         p1.draw(Color.GREEN);
      
      // Point 2
         p2.rotate(rotation, axis);
         p2.draw();
      
      // Point 3
         p3.rotate(rotation, axis);
         p3.draw();   
      
      // Line
         p1.drawLine(p2, Color.GREEN);
         p2.drawLine(p3);
         p3.drawLine(p1);
         
         //Wait.milliSec(200);
      
      }
      
   
      
      // Dots in a row (using disposable points)
      //g.setColor(Color.ORANGE);
      //new PointIG(10, 0, g, scale).draw();
      //new PointIG(10, 1, g, scale).draw();
      //new PointIG(10, 2, g, scale).draw();
      //new PointIG(10, 3, g, scale).draw();
   
   }
}