DrawScript

home.gif


Magic Rose


Join all the vertices of a regular polygon to each other and you have a magic rose. The DrawScript ·Line() command can be used.

rose.gif
REM -----------------------------------------
REM Magic Rose consists of all the lines
REM joining the vertices of a regular polygon
REM -----------------------------------------

radius=5 :  ·Origin(radius+1,radius+1)

n=20  : DIM x(n),y(n) : REM Vertices

REM Calculate position of vertices

 FOR i=0 TO n
  x(i)=radius*COS(2*PI*i/n)
  y(i)=radius*SIN(2*PI*i/n)
  NEXT

REM Join vertices with straight lines
FOR i=0 TO n
 FOR j=0 TO n
  ·Line(x(i),y(i),x(j),y(j))
  NEXT
  NEXT