
Drawing Spirograph curves in Python - chmaynard
https://www.johndcook.com/blog/2018/08/30/drawing-spirograph-curves-in-python/
======
erikschoster
These are really fun shapes to play with -- here's another little python
script to draw animated hypotrochoid frames that can be stitched together with
ffmpeg:
[https://github.com/hecanjog/hypotrochoid.py/blob/master/hypo...](https://github.com/hecanjog/hypotrochoid.py/blob/master/hypo.py#L47)

I stole the relevant bit from here:
[https://stackoverflow.com/questions/22894942/plotting-
hypotr...](https://stackoverflow.com/questions/22894942/plotting-
hypotrochoids-using-python/22895353#22895353)

Here's one video example:
[https://vimeo.com/99493389](https://vimeo.com/99493389)

------
sytelus
When moving circle is inside, its called Hypotrochoid
[https://en.wikipedia.org/wiki/Hypotrochoid](https://en.wikipedia.org/wiki/Hypotrochoid)

When moving circle is outside, its called Epitrochoid
[https://en.wikipedia.org/wiki/Epitrochoid](https://en.wikipedia.org/wiki/Epitrochoid)

The difference between two is sign for radius for moving circle.

Overall this is just ploting parametric equations in 2D in Python using
complex number trick.

~~~
vram22
>When moving circle is outside, its called Epitrochoid
>[https://en.wikipedia.org/wiki/Epitrochoid](https://en.wikipedia.org/wiki/Epitrochoid)

The combustion chamber of the Wankel engine is an epitrochoid. (From the above
Wikipedia link.)

I had read up about Wankel (and also the more conventional internal
combustion) engines as a kid. Thought the Wankel engine idea was cool. It has
both pros and cons.

[https://en.wikipedia.org/wiki/Wankel_engine](https://en.wikipedia.org/wiki/Wankel_engine)

------
netcraft
Its mentioned at the bottom of the article, but thought its worth calling out
here too:
[https://nathanfriend.io/inspirograph/](https://nathanfriend.io/inspirograph/)

------
cheesysam
It's not a spirograph curve unless the cog teeth have slipped and your pen has
scrawled across the page taking up a bit of paper with it and you have to
start again.

~~~
eggy
Agreed. As much as I like coding and generative art too, there's nothing like
the effort of keeping the smaller gear inside the larger one and going fast.
Much harder on the outside! I just picked up a $8 Spirograph in tin case for
my three year old.

------
moolcool
Did you know there's a direct correlation between the decline of Spirograph
and the rise in gang activity? Think about it!

~~~
hour_glass
I'm going to mail one to the oval office. I think spirographs could save us
from nuclear war.

------
abecedarius
There's been progress since the 80s when I typed in Basic code for this from a
magazine -- it was quite a bit harder to follow.

