Polyspiral

Post Reply
User avatar
rbytes
Posts: 1963
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone X
iPad 4
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Polyspiral

Post by rbytes » Tue Jan 22, 2019 6:45 pm

;)
Attachments
21DF329F-45FE-4DB0-A911-696949A0EDC0.png
21DF329F-45FE-4DB0-A911-696949A0EDC0.png (1.73 MiB) Viewed 287 times
839E063B-3AD2-412E-95DC-BE50B1C7F73C.png
839E063B-3AD2-412E-95DC-BE50B1C7F73C.png (1.57 MiB) Viewed 287 times
9216F0E1-7236-4518-AFB0-2F4BB441528B.png
9216F0E1-7236-4518-AFB0-2F4BB441528B.png (1.18 MiB) Viewed 287 times
Last edited by rbytes on Thu Jun 13, 2019 5:39 am, edited 1 time in total.
Zzzzz

User avatar
GeorgeMcGinn
Posts: 495
Joined: Sat Sep 10, 2016 6:37 am
My devices: IPad Pro 10.5in
IMac
Location: Venice, FL
Flag: United States of America
Contact:

Re: Polyspiral

Post by GeorgeMcGinn » Thu Jan 24, 2019 9:03 am

Here is one I like - incr 566

Is there a way to make sure the points or edges are not cut off because of its poximity to the edges?

I will look into moving the incr display either after you request termination or move it where it will have the least impact. I was thinking of when terminating the program, doing a HIDE for that display field.

However, watching it go though all the increments is very relaxing and could be hypnotic! Great job rbytes.
IMG_0840.PNG
IMG_0840.PNG (2.83 MiB) Viewed 274 times
George McGinn
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)
https://www.georgemcginn.com
https://www.cosmologyandspace.blog

User avatar
rbytes
Posts: 1963
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone X
iPad 4
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: Polyspiral

Post by rbytes » Thu Jan 24, 2019 10:35 am

Here is one I like - incr 566

Is there a way to make sure the points or edges are not cut off because of its poximity to the edges?

I will look into moving the incr display either after you request termination or move it where it will have the least impact. I was thinking of when terminating the program, doing a HIDE for that display field.

However, watching it go though all the increments is very relaxing and could be hypnotic! Great job rbytes.
Thanks for the kind comments, George. I had to think about your questions, because I hadn't really considered what would happen when incr grew beyond 360. I did some testing, and I see that all patterns repeat after that. For example, I get the same pattern as 566 when I set incr to 566-360 (206). I get the mirror image when I set incr to 360-206 (154). See the screenshots below.

I also experimented with changing the size of the pattern to avoid cutting off the edges. The answer is to change the statement length += 3, which you will find inside the i loop. Change it to length += 2.5 and your shape will just nicely fit on the iPad screen.

Finally, I noticed that the last loop always left an unconnected line at the outside edge. You can see it at the top of screenshot 1 and the bottom of screenshot 2. So I added code to make the final line only half the normal length. Substitute the following code for the two lines after "for i=1 to sides"

if i=sides then
x += length*COS(ANGLE)/2
y += length*SIN(ANGLE)/2
else
x += length*COS(ANGLE)
y += length*SIN(ANGLE)
endif

That way the last line is only half as long, so its unconnected end is hidden at the center of the drawing, making the drawing look more finished.

screenshot 1 shows the pattern generated with incr=206 (566-360) It is the same pattern generated by incr=566
screenshot 2 shows the mirror image generated with incr=360-206 (154)
screenshot 3 shows the fix for the last line drawn.
Attachments
E7D65D8E-CF20-42B1-86D0-FE5A7D50EF51.png
E7D65D8E-CF20-42B1-86D0-FE5A7D50EF51.png (1.21 MiB) Viewed 272 times
9B5A6E89-CAE0-4890-99F1-8C64B5CDBA41.png
9B5A6E89-CAE0-4890-99F1-8C64B5CDBA41.png (1.22 MiB) Viewed 272 times
7D2DC1EB-12E6-4745-9506-3DD1821DDE72.png
7D2DC1EB-12E6-4745-9506-3DD1821DDE72.png (1.21 MiB) Viewed 272 times
Zzzzz

User avatar
GeorgeMcGinn
Posts: 495
Joined: Sat Sep 10, 2016 6:37 am
My devices: IPad Pro 10.5in
IMac
Location: Venice, FL
Flag: United States of America
Contact:

Re: Polyspiral

Post by GeorgeMcGinn » Thu Jan 24, 2019 4:03 pm

I never noticed they repeated. I guess by the time it came around again, I was too mesmerized to realize it.

I did notice that it produced mirror images, like the 206 and 154 you provided. Sometimes I thought I even saw the change in directions!

I'll insert the code later today, as my month from hell hasn't ended. Two days ago a good friend of mine killed herself. I'll send you an email later today, for this one was bizarre, and I almost lost 3 friends that night!

Anyway, thanks for the program and the changes. I hope to be more active this year.
George McGinn
Computer Scientist/Cosmologist/Writer/Photographer
Member: IEEE, IEEE Computer Society
IEEE Sensors Council & IoT Technical Community
American Association for the Advancement of Science (AAAS)
https://www.georgemcginn.com
https://www.cosmologyandspace.blog

Post Reply