The Spirograph Curve, Explained
After reading this you will be able to predict the shape a spirograph draws from three numbers: the ring radius, the wheel radius and the pen offset. You will know when the curve closes, when it fills a band, and how many petals to expect.
What a spirograph actually traces
Take a large fixed circle. Roll a smaller circle around it without slipping. Pick a point somewhere on the rolling circle, or inside it, and hold a pen there. As the small circle rolls, the pen sweeps out a looping curve. That curve is a spirograph.
Roll the small circle inside the big one and the pen traces a hypotrochoid. Roll it outside and you get an epitrochoid. The plastic toy uses gear teeth to enforce the no-slip condition, but the mathematics only needs the rolling contact.
Here is the hook. Set the ring radius to 5, the wheel radius to 3 and the pen at the wheel's rim. The pen returns to its start after the wheel makes exactly 3 trips around the ring, and it draws a clean 5-pointed star loop. Change the wheel radius to 2.99 and the curve never quite closes: it keeps drawing slightly shifted copies until the whole band is a dense mesh of thread. One tiny change to a radius decides between a 5-petal figure and a near-solid ring.
When to reach for this model
A spirograph is a study in two coupled rotations. Use it when you want to see how a ratio of frequencies controls whether a periodic motion repeats or drifts forever. That question shows up in gear trains, planetary conjunctions, and the beat patterns of two tuning forks.
It is a toy, and it is honest about that. It says nothing about friction, elasticity, or gear backlash. Real gears slip a little and wear down; the equations here assume perfect rolling. If you want irregular or unpredictable output, look elsewhere: a spirograph is fully deterministic and always periodic when the radius ratio is rational. For genuine sensitivity to starting conditions, the Lorenz attractor or the magnetic pendulum fractal are the right tools.
The two equations
Let R be the ring radius, r the rolling wheel radius, and d the pen's distance from the wheel's centre. For the hypotrochoid (wheel inside the ring):
The angle t is how far the wheel's centre has swung around the ring's centre. The first term places the wheel's centre on a circle of radius R - r. The second term rotates the pen around that moving centre. The ratio \frac{R-r}{r} is how many times the pen spins for each full swing of the centre, and it sets the number of petals.
For the epitrochoid (wheel outside the ring), swap the signs so the wheel centre rides on a circle of radius R + r:
The pen offset d alone controls the shape's character. When d \lt r the curve is smooth and rounded. When d = r the pen sits on the rim and each petal ends in a sharp cusp. When d \gt r the petals overshoot and cross themselves into inner loops.
The same sum-of-two-rotations idea drives the Fourier epicycles tool. A spirograph is a Fourier series with exactly two terms; stack thousands of them and you can redraw any closed curve.
Worked example: reproducing the demo
Ring 5, wheel 3, pen on the rim
Use the demo defaults: R = 5, r = 3, d = 3, drawn as a hypotrochoid.
- The wheel centre rides on a circle of radius R - r = 5 - 3 = 2.
- The pen frequency ratio is \frac{R-r}{r} = \frac{2}{3} \approx 0.6667.
- The curve closes when both rotations return together. Reduce R/r = 5/3 to lowest terms: it is already reduced, denominator 3. So the wheel makes 3 trips (t runs from
0to 6\pi) before repeating. - Number of petals equals that reduced numerator,
5. You get a 5-lobed figure. - Check t = 0: x = 2\cos 0 + 3\cos 0 = 2 + 3 = 5, y = 2\sin 0 - 3\sin 0 = 0. The pen starts at
(5, 0), on the ring's outer edge. - Check t = \pi: x = 2\cos\pi + 3\cos(0.6667\pi) = -2 + 3(-0.5) = -3.5. The inner reach at this angle is
3.5, well inside the outer radius of5.
Because d = r = 3, the pen sits exactly on the rim, so each of the 5 petals ends in a sharp cusp rather than a rounded tip.
Reading the shape from the numbers
Two facts do almost all the interpretation work.
Petal count and closure come from the reduced ratio. Write R/r in lowest terms as p/q, where p = R/\gcd(R,r) and q = r/\gcd(R,r). The figure has p petals and closes after the wheel makes q loops. For R=5, r=3, \gcd(5,3)=1, so p=5 petals closing after q=3 loops.
Pen offset sets the tip shape. The sign of d - r decides everything. Below the rim, rounded. On the rim, cusped. Beyond the rim, self-crossing loops.
| R | r | gcd | Petals p | Loops q | Looks like |
|---|---|---|---|---|---|
| 5 | 3 | 1 | 5 | 3 | 5-point star |
| 6 | 4 | 2 | 3 | 2 | 3-petal flower |
| 8 | 3 | 1 | 8 | 3 | 8-point rosette |
| 10 | 5 | 5 | 2 | 1 | simple ellipse-like loop |
| 97 | 89 | 1 | 97 | 89 | near-solid band |
Common mistakes
The errors below are the ones that make a spirograph look wrong when the math is fine.
- Stopping the trace too early
- If you run t only from
0to 2\pi for R=97, r=89, you draw one thread of a figure that needs 89 loops to close. It looks like a single lopsided loop, not a rosette. Run t to 2\pi q. - Confusing offset with wheel size
- Making the petals sharper is a job for d, not r. Changing r changes the petal count and closure; changing d keeps the count fixed and only reshapes each tip.
- Expecting a rational curve to fill the band
- A dense mesh needs a ratio with a large reduced denominator, like 89. A ratio like 10/5 = 2/1 closes after a single loop and can never fill anything.
Truly irrational ratios never close at all: the curve is dense in the annulus and would take infinite time to draw. On a computer every number you enter is rational, so the figure always closes eventually. What looks like a filled band is really an enormous but finite q.
Related tools on this site
If the two-rotation idea interests you, extend it with the Fourier epicycles tool, which chains many rotations to trace any drawing. For a different way that simple rules produce ordered patterns, try the Phyllotaxis tool, where the golden angle packs seeds into Fibonacci spirals. And for how a single ratio can tip a system from order into chaos, the logistic map bifurcation shows a parameter splitting a stable point into 2, 4, then a chaotic band.
Frequently asked questions
Why does 5/3 draw a clean star but 97/89 looks solid?
Both ratios are already in lowest terms. The number of loops needed to close is the denominator: 3 for the first, 89 for the second. With 89 near-identical loops packed into the same band, the threads sit close enough to read as a solid ring at screen resolution.
How many petals will I get?
Reduce the ratio of ring to wheel radius to lowest terms. The numerator is the petal count. Ring 8 and wheel 3 give 8/3, so 8 petals.
What is the difference between a trochoid and the toy's curve?
A trochoid is the general name for the path of a point attached to a rolling circle. Hypotrochoid means the circle rolls inside another; epitrochoid means it rolls outside. The plastic spirograph draws both, depending on whether you use the ring's inner or outer teeth.
Can I get a perfect circle?
Set the pen offset d to 0. The pen sits at the wheel's centre, which rides on a circle of radius R-r (hypotrochoid) or R+r (epitrochoid). No petals, just a plain circle.
Why do some petals cross themselves?
When the pen offset exceeds the wheel radius (d \gt r), the pen swings out farther than the rolling contact, so it overshoots and folds back through its own path, forming an inner loop at each petal tip.