Point p1 = new Point(1, 2);
Point p2 = new Point(2, 7);
- Point p3 = p1.additionner(p2);
-
- System.out.println(p1.toString());
- System.out.println(p2.toString());
- System.out.println(p3.toString());
-
- Point p4 = new Point(4, 5);
- Point p5 = new Point(2, 3);
- Segment segment = new Segment(p4, p5);
- Cercle cercle = new Cercle(p4, 5.2);
-
+ Segment segment = new Segment(p1, p2);
+ Point p3 = new Point(4, 5);
+ Cercle cercle = new Cercle(p3, 5.2);
+ Point p4 = new Point(2, 3);
Piletransformations trans = new Piletransformations(10);
- trans.display();
-
- segment.dessiner(trans);
- cercle.dessiner(trans);
- boolean rt = trans.empiler(p1);
- trans.display();
- segment.dessiner(trans);
- cercle.dessiner(trans);
- rt = trans.empiler(p2);
- trans.display();
- segment.dessiner(trans);
- cercle.dessiner(trans);
+ boolean rt = trans.empiler(p4);
- segment.deplacer(p1);
- cercle.deplacer(p1);
segment.dessiner(trans);
cercle.dessiner(trans);
+ Image image = new Image();
+ image.ajouter(segment);
+ image.ajouter(cercle);
+ image.dessiner(trans);
}
}
Point pTrans = pile.getCurrentTransformation();
Point pOriTrans = pOri.additionner(pTrans);
Point pDestTrans = pDest.additionner(pTrans);
- System.out.println(className + " " + pOri.toString()+ "->" + pOriTrans.toString() + " " + pDest.toString() + "->" + pDestTrans.toString());
+ System.out.println(className + " " + pOri.toString()+ "->" + pOriTrans.toString() + " " +
+ pDest.toString() + "->" + pDestTrans.toString());
}
public void deplacer(Point p) {