Basic HTML version of Foils prepared 13 July 98

Foil 65 Regular n-gons

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

The DrawablePolygon Class
There is a DrawablePolygon constructor for regular n-gons
The basic idea is to repeatedly rotate an initial vertex by a fixed amount: this.addPoint( p ); for ( int i = 1; i < n; i++ ) { // rotate the previous point: p = p.rotate( theta ); this.addPoint( 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