|
Post by David Drake on Mar 2, 2020 7:29:10 GMT -5
I adapted the code below from the IS-BASIC example for the task Archimedean spiral (found here: rosettacode.org/wiki/Archimedean_spiral). Requirements: The Archimedean spiral is a spiral named after the Greek mathematician Archimedes. Draw an Archimedean spiral. 'The Archimedean spiral is a spiral named after the Greek mathematician Archimedes. 'Draw an Archimedean spiral.
nomainwin WindowWidth=800 WindowHeight=600 UpperLeftX=1 UpperLeftY=1
open "Spiral" for graphics_nf_nsb as #1 #1 "trapclose [q];down;fill black;flush;color green;size 3;"
pi=acs(-1) xcenter=DisplayWidth/4 ycenter=DisplayHeight/3 a=15:b=15
for c=0 TO 6.5*pi step 0.01 r=a+b*c #1 "set ";xcenter+r*cos(c);" ";ycenter+r*sin(c) next c wait
[q] close #1:end
I look forward to hearing your thoughts.
|
|
|
Post by tsh73 on Mar 2, 2020 8:32:36 GMT -5
There is a way to get graphicbox/graphic window center
insert code here #1 "home;posxy xcenter ycenter"
'The Archimedean spiral is a spiral named after the Greek mathematician Archimedes. 'Draw an Archimedean spiral.
nomainwin WindowWidth=800 WindowHeight=600 UpperLeftX=1 UpperLeftY=1
open "Spiral" for graphics_nf_nsb as #1 #1 "trapclose [q];down;fill black;flush;color green;size 3;home;posxy xcenter ycenter"
pi=acs(-1) a=15:b=15
for c=0 TO 6*pi step 0.01 r=a+b*c #1 "set ";xcenter+r*cos(c);" ";ycenter+r*sin(c) next c wait
[q] close #1:end
|
|
|
Post by David Drake on Mar 3, 2020 13:50:57 GMT -5
Nice tip. I have trouble remembering that I can do that.
|
|