
-----------------------------------
jamez
Sun Nov 30, 2003 8:59 pm

Spirographs
-----------------------------------
:D

View.Set ("nocursor,nobuttonbar,title:Spirograph") 

var R : real := Rand.Int (20, 35) 
var r : real := Rand.Int (20, 35) 
var O : real := Rand.Int (5, 10) 
var T : real := Rand.Int (100, 400) 
var x, y, oldx, oldy : real := 0 
var g : string (1) 

loop 
    put "1. Random\n2. Specify" 
    getch (g) 
    exit when g = '1' or g = '2' 
end loop 
if g = '2' then 
    put "R [Fixed circle radius]: " .. 
    get R 
    put "r [Moving circle radius]: " .. 
    get r 
    put "O [Offset of the moving circle]: " .. 
    get O 
    put "T [# of circles]: " .. 
    get T 
end if 
cls 

put "\nR: ", R .. 
put "\nr: ", r .. 
put "\nO: ", O .. 
put "\nT: ", T .. 

for t : 1 .. round (T) 
    oldx := x 
    oldy := y 
    x := (R + r) * cos (t) - (r + O) * cos (((R + r) / r) * t) 
    y := (R + r) * sin (t) - (r + O) * sin (((R + r) / r) * t) 

    if t > 1 then 
        drawline (round (x) + maxx div 2, round (y) + maxy div 2, round (oldx) + maxx div 2, round (oldy) + maxy div 2, 255) 
    end if 
end for

-----------------------------------
jamez
Sun Nov 30, 2003 9:00 pm


-----------------------------------
P.S. long time no see peeps

-----------------------------------
Andy
Sun Nov 30, 2003 9:04 pm


-----------------------------------
hmmm interesting... although you could've drawn it once and use Pic.Rotate

-----------------------------------
CITC
Sun Jan 11, 2004 6:55 pm


-----------------------------------
awesome, looks really cool!
