aUCBLogo Demos and Tests / mul4
to mul4
; ring with c groups of nrcol colors
cS hT setSC 4 noRefresh setPS Se 2 2
colors = se iseq 0 8 iseq 9 14
nrcol=count colors
m=0 alpha=-Pi/2 zwoPi=2*Pi r=280
c=18 p=c*nrcol g=c*p*3
if lessEqualP p nrcol [nrcol=p]
ip=-int(p/2) zp=zwoPi/p zwoPig=zwoPi/g
for [f 0 g-1]
[ fzwoPig=f*zwoPig
for [n 1 g-1]
[ beta=(ip+mod m p)*zp
ab=alpha+beta
phi1=ab+fzwoPig
x1=r*radCos phi1
y1=r*radSin phi1
phi2=ab+zwoPig*(mod n*f g)
x2=r*radCos phi2
y2=r*radSin phi2
coords=fPut Se x1 y1 lPut Se x2 y2 []
line coords Item (1+mod m nrcol) colors m=m+1
]
updateGraph
if key? [stop]
]
end