|
Post by tsh73 on Feb 20, 2020 8:48:29 GMT
happened in MathCad tutorial as an example, looks nice nomainwin open "spiral" for graphics_nsb_nf as #gr #gr "trapclose [quit]" #gr "home; down; posxy cx cy"
for i = 1 to 150 x = cx+i*cos(i) y = cy+i*sin(i) #gr "goto ";x;" ";y next #gr "flush" wait
[quit] close #gr end
|
|
|
Post by B+ on Feb 20, 2020 21:08:33 GMT
Variations:
nomainwin open "spiral" for graphics_nsb_nf as #gr #gr "trapclose [quit]" #gr "home; down; posxy cx cy" pi = acs(-1) print pi a = pi/2 for i = 1 to 160
'pick one or mix and match ha, ha, ha a = a + 2*pi/3 + pi/128 'triangles + 'a = a + pi/2 + pi/128 'squares + 'a = a + pi/4 + pi/4^4 'octagon + 'a = a + pi/3 + pi/256 'hexagon 'a = a + 2*pi/5 + pi/128 'pentagram 'a = a + i*pi + pi/128 'oh nice
x = cx+i*cos(a) y = cy+i*sin(a) #gr "goto ";x;" ";y next #gr "flush" wait
[quit] close #gr end
|
|
|
Post by tsh73 on Feb 20, 2020 21:35:47 GMT
Wow. I have to demonstrate it to folks
|
|
|
Post by B+ on Feb 21, 2020 2:15:04 GMT
OK some demos: Triangles, Octagon and Mix & Match of Triangle + Hexagon + Oh nice!
|
|
|
Post by zzz000abc on Feb 25, 2020 17:12:49 GMT
the combination of triangle and a polygon gives flower structure for example triangle and square. tsh's posts interesting for usually containing original works B+'s for quick enhancements.
|
|
|
Post by B+ on Feb 25, 2020 17:32:07 GMT
I was thinking someone could modify the comment on/off section with one or more inputs to explore even more spirals.
This turns a few lines of code into a universe of potentialities!
|
|
|
Post by tsh73 on Feb 25, 2020 20:28:57 GMT
This one was found by a student a = a + 2*2*pi/5 ... y = cy-i*sin(a) 'upside down
|
|
|
Post by B+ on Feb 26, 2020 20:33:07 GMT
Cool! another way to flip: y = cy+i*sin(a + pi) Like star here is triangle (or pyramid?) a = a + 4*pi/3 'triangle with flip mod
|
|
|
Post by B+ on Feb 26, 2020 20:55:34 GMT
New class n-stars: 'n stars pi * (n+1)/n a = a + pi* 14/13 'with flip
|
|
|
Post by B+ on Feb 26, 2020 21:13:13 GMT
Oh yeah, those spikes are actually are getting shorter, so this 'n stars pi * (n+1)/n a = a + pi* 119/118
looks like
|
|