The idea: a circle rolling in a ring
A Spirograph is a toy: a toothed ring is pinned to the paper, a small toothed wheel rolls around inside it, and a pen through a hole in the wheel draws. The ring has radius R, the wheel radius r, and the pen hole sits at distance d from the wheel's centre. Rolling inside gives a hypotrochoid; rolling around the outside gives an epitrochoid.
The formula
Two things move. The centre of the small circle goes around O on a circle of radius R − r (inside) or R + r (outside), at angle t. And the small circle spins. Because it rolls without slipping, the arc it rolls over on the ring, R·t, equals the arc of its own rim that touched the ring. Counting the spin in the fixed frame of the paper, the arm turns k times per turn of the centre:
inside: x = (R − r) cos t + d cos(k t) y = (R − r) sin t − d sin(k t) k = (R − r)/r
outside: x = (R + r) cos t − d cos(k t) y = (R + r) sin t − d sin(k t) k = (R + r)/r
The minus sign in y means: inside, the wheel spins the other way to its trip around the ring (clockwise while t goes counter-clockwise). Outside it spins the same way. With R = 10, r = 3 inside, k = 7/3: the centre goes around once while the wheel spins 2⅓ times backwards.
In complex numbers the pen is just the sum of two rotating arrows, (R − r)·eit + d·e−ikt: see Euler's Formula. Adding more arrows like this is how the epicycles on Fourier Series, Harmonic by Harmonic draw any closed curve.
When does the curve close?
After the centre has gone around n times, the arm has turned n·k = n·(R − r)/r times. The pen is back at its start only when both are whole numbers, that is when n·R/r is whole. The smallest such n is
turns to close = r / gcd(R, r) points (loops, petals) = R / gcd(R, r)
The pen comes to the ring once every r/R of a turn, so in r/gcd turns it does that R/gcd times: the picture has R/gcd-fold symmetry. Dividing by the gcd matters: R = 8, r = 2 is really R = 4, r = 1, one turn and 4 points, not 8. (The gcd itself comes from Euclid's algorithm.)
| R | r | gcd | turns to close | points | arm spins (inside) |
|---|---|---|---|---|---|
| 10 | 3 | 1 | 3 | 10 | 7 |
| 8 | 2 | 2 | 1 | 4 | 3 |
| 5 | 3 | 1 | 3 | 5 | 2 |
| 11 | 7 | 1 | 7 | 11 | 4 |
| 10 | 4 | 2 | 2 | 5 | 3 |
(Demo: roll R = 10, r = 3, d = 5: at the end of turn 1 the centre is back but the pen is not; it closes after turn 3 with 10 loops. Demo: many loops: R = 11, r = 7, d = 9 needs 7 turns.) If r/R were irrational the curve would never close and would slowly fill a ring-shaped band.
What d does: smooth, cusps or loops
The pen's speed is the speed of the centre plus the speed of its spin around the centre. When the pen is on the ring side of the wheel these two point in opposite directions.
- d < r: the spin part is smaller, the pen never stops: a smooth wavy curve.
- d = r: the pen is on the rim. At the contact point the rim does not move (that is what rolling means), so the pen stops dead and turns back: a cusp on the ring. These curves are the hypocycloids and epicycloids.
- d > r: the pen goes past the rim and the spin wins: the pen moves backwards for a moment and makes a loop that crosses itself.
(Demo: d < r, d = r, d > r (R = 10, r = 4).)
Curves with names
| rolls | R : r | d | curve |
|---|---|---|---|
| inside | 3 : 1 | r | deltoid, 3 cusps |
| inside | 4 : 1 | r | astroid, 4 cusps |
| inside | 5 : 3 | r | a 5-point star drawn in 3 turns |
| inside | 2 : 1 | ≠ r | an ellipse |
| inside | 2 : 1 | r | a straight line, a diameter (the Tusi couple) |
| outside | 1 : 1 | r | cardioid, 1 cusp |
| outside | 2 : 1 | r | nephroid, 2 cusps |
| outside | 1 : 1 | ≠ r | a limaçon |
| either | any | 0 | a circle: the pen is the centre |
The R = 2r case is a surprise: the wheel is exactly half the ring, and every point of its rim moves back and forth on a straight line. (Demo: astroid, Demo: deltoid, Demo: 5-point star.) The cardioid also comes up in polar coordinates as r = 1 − cos θ: see Polar Coordinates.
Rolling outside: the coin paradox
Outside, k = (R + r)/r = R/r + 1. Roll one coin around another coin of the same size (R = r) and it turns twice, not once: once for the distance rolled, plus once because it went all the way round. That is why the cardioid demo's arm spins 2 times. (Demo: cardioid, Demo: nephroid.) The closing rule is the same: r/gcd turns, R/gcd points.
Counting points around a circle shows up again in rose curves r = cos(kθ), where k sets the number of petals: see Rose Curves and Maurer Roses.
What the page leaves out
Non-integer and irrational radii (the curve never closes), real Spirograph wheels counted in teeth (the same rule with tooth counts), the arc length and area of the curves, rolling on shapes that are not circles, and curves built from more than two rotating arms. R stays between 2 and 12 and r between 1 and 9.