Friday, December 28, 2012

Gears

clg
fastgraphics
dim x(3)
dim y(3)
dim rad(3)
dim init(3)
x[0]=150
y[0]=150
rad[0]=70
init[0]=0
x[1]=220
y[1]=220
rad[1]=35
init[1]=-.15
x[2]=90
y[2]=90
rad[2]=21
init[2]=.2
for rot = 0 to 100000
   for w = 0 to 2
      circle x[w],y[w],rad[w]-8
      tri = {0, 0, -5, rad[w], 5, rad[w]}
      for r = 0 to 2*pi step pi*7/rad[w]
           if w=1 or w=2 then clock = -rot
           if w=0 then clock = rot
           stamp x[w],y[w],1,r+init[w]+clock/(7*rad[w]),tri
       next r
    next w
    refresh
    clg
next rot