aUCBLogo Demos and Tests / mul2


to mul2
   
; Multiplikativer Zahlring, nur drei Farben, Wechsel nach jeder Linie
   
cS hT setSC 0 noRefresh
   
g=105 r=300 ; Radius des Kreises
   
alpha=-Pi/2 ; der erste Punkt liegt dann unten
   
i=0 colors=(List RGB 1 0 0  RGB 0 1 0  RGB 0 0 1)

   
for [f 0 g-1]
   
[   for [n 1 g-1]
      
[   phi=alpha+2*Pi*f/g            
         
x1=r*RadCos phi 
         
y1=r*RadSin phi
         
         
phi=alpha+2*Pi*(mod n*f g)/g  
         
x2=r*RadCos phi 
         
y2=r*RadSin phi
         
         
coords=fPut Se x1 y1 lPut Se x2 y2 []
         
line coords Item (1+mod i 3) colors i=i+1
      
]
      
updateGraph
   
]
end