27 lines
735 B
Text
27 lines
735 B
Text
'archimedean spiral.bas
|
|
'runs in Run Basic
|
|
'Run Basic website http://www.runbasic.com
|
|
'From Rosettacode.org/wiki/ *** Liberty_BASIC
|
|
|
|
graphic #g, 300,300 'width and height - the center is 150
|
|
c = 255 '255 for white '0 for black
|
|
print "Welcome to the Arch-Spiral Program"
|
|
|
|
pi=acs(-1)
|
|
nLoops = 5
|
|
#g cls("blue") 'blue background color
|
|
#g color(c,c,c) 'set line color - see color above
|
|
|
|
for t=0 to 2*pi*nLoops step 0.01
|
|
'c = c - 1 'changes color parameter
|
|
x=100*t/(2*pi*nLoops)*cos(t)+150 '150x150 is the center
|
|
y=100*t/(2*pi*nLoops)*sin(t)+150
|
|
#g color(c,c,c) 'changes color
|
|
#g set(x,y)
|
|
'if c <1 then c=255
|
|
next
|
|
render #g
|
|
|
|
print "Thank you and Goodbye"
|
|
end
|
|
End
|