%begin

   %include "inc:maths.imp"
   %include "mach:extl1.imp"
   %const %integer cx=344, cy=256
   %integer i, j, c, cb, size, in, out, n
   %real %array x, y(1:128)
   clear
   offset(0,0)
   cb = 0
   prompt("number of points(<=25) :")
   read(n) %until 2<=n<=64
   prompt("ratio of arms to body :")
   read(out) %until out>0
   read(in) %until in>0
   %if in>out %start
      i = in
      in = out
      out = i
   %finish
   %for i = 2, 2, 2*n %cycle
      x(i-1) = cos(pi*(i-1)/n+pi/2)
      y(i-1) = sin(pi*(i-1)/n+pi/2)
      x(i) = cos(pi*i/n+pi/2)*out/in
      y(i) = sin(pi*i/n+pi/2)*out/in
   %repeat
   c = 0
   %for size = (intpt(256*in/out)-4)&\3, -1, 1 %cycle
      c = rem(c, 255)+1
      set colour(c)
      poly(cx+intpt(x(j)*size), cy+intpt(y(j)*size)) %for j = 1, 1, 2*n
      close poly
   %repeat
%end %of %program
