Construction


Created by JSPgenerator.

JSPgenerator Source

function RegularPolygon(a,b,num,options)
/*Constructs the num vertices of a regular polygon with centre a and b as first vertex */
{var points=new Array(num)
points[0]=b
for(var i=1;i<num;i++){
points[i]=Rotation(points[i-1],a,Math.PI*2/num,options)}
return points}

function PolygonBorder(a,options){
for (var i=0;i<a.length-1;i++){
Segment(a[i],a[i+1],options)}
Segment(a[a.length-1],a[0],options)
}
a=Point(150,120,'')
b=Point(200,200,'')
z=RegularPolygon(a,b,12,'hidden')
Polygon(z,'green')
PolygonBorder(z,'thick')