0010 USE UNIGRAPHICS
0020
0030 n:=17
0040 DIM x(n), y(n)
0050
0060 graphicscreen(0)
0065 clear
0070 interiorcolor(3)
0080 outlinecolor(1)
0090 make_circle(n,x(),y(),320,100,95)
0100 polygon(n,x(),y())
0110 WHILE key$="" DO WAIT
0120 textscreen
0130  //
0140
0150 PROC make_circle(n,REF x(),REF y(),x0,y0,r) CLOSED
0160   FOR i:=1 TO n DO
0170     rad:=(i-1)/(n-1)*pi*2
0180     IF i MOD 2 THEN
0190       r':=r
0200     ELSE
0210       r':=-r/2
0220     ENDIF
0230     x(i):=x0+r'*cos(rad)*2; y(i):=y0+r'*sin(rad)
0240   ENDFOR i
0250 ENDPROC make_circle
