1 | We're finally ready to show how to rotate a polygon about an arbitrary point: public DrawablePolygon rotate( double theta, Point p ) { int x, y; DrawablePoint q; this.translate( -p.x, -p.y ); // rotate each vertex as in the previous foil this.bounds = null; this.translate( p.x, p.y ); return this; } |