
Spirograph Simulator (2014) - ChuckMcM
http://nathanfriend.io/inspirograph/
======
vinchuco
There's a one-line formula that is supposed to capture most of these motions.
[https://en.wikipedia.org/wiki/Hypotrochoid](https://en.wikipedia.org/wiki/Hypotrochoid)

What always struck me as interesting is how some of them 'seem' like they're a
projection of a surface onto the plane.

Edit: In fact, it would be nice to see a 3d version where the z-axis is the
angle of incidence between gears (taking one as reference).

Especially in crazier patterns with gears that are not perfect circles. Too
sad this is far in the past:
[https://www.kickstarter.com/projects/465068187/wild-
gears-20...](https://www.kickstarter.com/projects/465068187/wild-
gears-20-reinventing-the-spirograph)

Note: in the starting position when you open the page, fixed 96, rotating 52.
13 revolutions for the curve to close. 52=4x13=gcd(52,96)x13

~~~
greeneggs
You could also have a 3D spirograph where you rotate an object with an
embedded "pen" around the inside of a sphere, say. It draws a 3D shape. This
would be very hard to construct, but easy to simulate. Would it give you
anything interesting, either as a line drawing or a surface?

~~~
MereInterest
I'm not sure, because you would have an additional degree of freedom that
needs to be constrained. With a 2D spirograph, you only have one axis of
rotation. You can rotate forwards or backwards, but there are no other
options. With a 3D object, there are always two possible axes of rotation. The
simplest way to handle it would be to only rotate around one axis, but then
you are back to just a normal 2D spirograph. There would need to be some non-
linear correlation between the rotations, which adds a great deal of
complexity.

~~~
vinchuco
I think the commenter meant to have it "keep going forward" in the same manner
as 2D but with some rotation involved. It's doable.

------
mathgenius
In case you think this is just a toy, have a look at what the professionals
do:

[https://johncarlosbaez.wordpress.com/2013/12/03/rolling-
hypo...](https://johncarlosbaez.wordpress.com/2013/12/03/rolling-
hypocycloids/)

~~~
ourcat
Amazing. Spinors are now my new favourite things.
[https://en.wikipedia.org/wiki/Spinor#Introduction](https://en.wikipedia.org/wiki/Spinor#Introduction)

~~~
ourcat
After seeing the Spinor 'belt' animations on that page, something in my gut is
screaming at me that there's some great use for this phenomenon in EMF power
generation.

------
amelius
This is nice. I wrote a spirograph simulator when I was 14 years old, but of
course it didn't have such nice UI (basically it was just a couple of calls of
sin(x) and cos(x) in a loop, and some graphics calls, it was much fun
nonetheless).

Some ideas:

\- Animate the rotation of the gears more smoothly for more realism.

\- Add an automatic mode, where the gears keep on moving until it reaches the
point when the path starts overlapping itself.

------
cantrevealname
I like physical things and I liked the original Spirograph. But that simulator
is _so much_ easier, quicker, and more flexible. You can't even mess up by
popping your pen or slipping gears.

Really, there's no reason to own a real Spirograph anymore. You might still
want a Spirograph for the same reason you'd want a Curta or an Enigma, i.e.,
for nostalgia or as a collector's item or to behold the sheer coolness of it.
But you or your kid would never play with a Spirograph today, or calculate
with a Curta, or encrypt with an Enigma.

I say all this with a bit of sadness because I miss things that I could hold
with my hand.

~~~
oliyoung
“you or your kid would never play with a Spirograph today”

yeah, we would …

~~~
illys
My daughter also spent months using one when she was 7-8, not so long ago!

------
jlarocco
Neat!

A while back I worked on a couple of Common Lisp projects that used the
equations behind Spirograph curves to generate animations synced up to music.

The results were really neat:
[https://vimeo.com/147813490](https://vimeo.com/147813490)

And the code: [https://github.com/jl2/spiro-
animation](https://github.com/jl2/spiro-animation)

I also made a GUI version that allows tweaking a bunch of settings:
[https://github.com/jl2/qt-3d-fft](https://github.com/jl2/qt-3d-fft)

------
zhirzh
This reminds me of a similar tool I wrote over a year ago. Uses d3 for SVG
features.

It's a bit cryptic about the inputs - can't really recall why I made it in the
first place.

demo: [https://zhirzh.github.io/spirograph-
gen](https://zhirzh.github.io/spirograph-gen)

source: [https://github.com/zhirzh/spirograph-
gen](https://github.com/zhirzh/spirograph-gen)

original source:
[https://gist.github.com/zhirzh/27172e92ae95b4167cc1](https://gist.github.com/zhirzh/27172e92ae95b4167cc1)

------
Jill_the_Pill
I love that it will let you mess up and over-draw a line just like the real
thing.

------
dang
Previously at
[https://news.ycombinator.com/item?id=8698131](https://news.ycombinator.com/item?id=8698131).

------
cordite
This would be really cool and fun for children if it worked on an iPad

------
nvr219
Couldn't stop playing with this, awesome.

------
sizzzzlerz
Very nice. A couple of suggestions:

\- Add ability to move the gear by shifting its position without rotating

\- Allow multiple pens

\- Shift colors randomly for a pen

\- Add elliptical gears

------
krylon
I had one of these as a kid, this brings up fond memories! :)

------
mrcactu5
this spirograph simulator has a really great UI.

countless, otherwise thoughtful, developers consider the User Interface as a
mere "finishing touch"

------
Exuma
All my childhood nightmares come rushing back.

------
Kenji
I loved these as a kid! This brings back memories. I've never thought about
the math behind it but maybe I should, this is awesome.

------
frozenport
Can you add a button that rotates the gear automatically?

~~~
Toadsoup
The arrow keys move it. Not quite automatic but easier than the mouse.

------
photogrammetry
INB4 no meta discussions.

How long is it until literally every comment on HN is just "this is unrelated,
but x."

~~~
dang
The difference is that those tangents were interesting and unpredictable,
where this one is unsubstantive.

We detached this subthread from
[https://news.ycombinator.com/item?id=13256464](https://news.ycombinator.com/item?id=13256464)
and marked it off-topic.

~~~
photogrammetry
You're a little late. The great-grandparent post was long gone from the front
page by the time you detached mine.

