Basic HTML version of Foils prepared 13 July 98

Foil 54 The centerRotate Method

From Java Academy II:Advanced Java NPAC/ECS Java Academy -- February to April 98. by Tom Scavo


Rotating about the polygon's center of gravity is not much harder: public DrawablePolygon centerRotate( double theta ) { Rectangle r = this.getBounds(); int x0 = r.x + r.width/2; int y0 = r.y + r.height/2; Point p = new Point( x0, y0 ); return this.rotate( theta, p ); }



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Nov 28 1998