How do you draw a spirograph that closes?
Set the gears or the pendulums and see the curve at once: spirograph rosettes and harmonograph spirals, from the numbers you choose.
What you enter stays on your device while you use this tool. Opening a shared link sends the settings in its address to HowToolbox to prepare the page.
Spirograph
Key values as a table
| Quantity | Value |
|---|---|
| Ring teeth | 96 |
| Wheel teeth | 40 |
| Pen hole distance | 28 |
| Lobes | 12 |
| Turns to close | 5 |
| Common divisor of the teeth | 8 |
In gear teeth. 40 is the rim of the wheel; more reaches beyond it.
A 40-tooth wheel in a 96-tooth ring draws a curve with 12 lobes and closes after 5 turns of the wheel.
Set the gears or the pendulums and see the curve at once: spirograph rosettes and harmonograph spirals, from the numbers you choose.
Press play to watch the pen trace the curve, step it on bit by bit, and zoom in on the loops.
How to use
- Pick the machine: a spirograph (a wheel rolling in a ring) or a harmonograph (two swinging pendulums).
- Type the gear teeth and the pen hole distance, or the pendulum frequencies. The curve is drawn at once.
- Read how many lobes the curve has and after how many turns it closes. Press Play on the picture to watch the pen draw it, and roll the wheel outside the ring or change the fading in the panel under it.
How it works
A spirograph pen sits in a hole of a small wheel that rolls round the inside of a ring. Every tooth that passes the ring turns the wheel a little, and the pen traces a rosette. The wheel returns to its start only when whole numbers of teeth have passed, so the curve closes after the wheel has gone round enough times, and the shape has as many lobes as the teeth share in common.
With a ring of R teeth, a wheel of r teeth and the pen d teeth from the wheel's centre, the pen is at x = (R − r) cos t + d cos((R − r) t ÷ r) and y = (R − r) sin t − d sin((R − r) t ÷ r). Let g be the greatest common divisor of R and r. The curve has R ÷ g lobes and closes after r ÷ g turns. For example a 96-tooth ring and a 40-tooth wheel give g = 8, so 12 lobes after 5 turns. A harmonograph adds two sine waves for each axis, each fading with time, so the pen spirals inwards. Whole-number frequencies close the shape and a small detune makes it turn slowly.
The pen hole distance changes the look: near the wheel's centre the curve is gentle, near the rim it grows loops, and beyond the rim the loops are large. The picture is idealised: real plastic gears slip a little and real pens leave a line of some width.
Sources
- Wolfram MathWorld: EpitrochoidUsed for: formula
- Wolfram MathWorld: HypotrochoidUsed for: formula
Frequently asked questions
How many lobes does my spirograph have?
Divide the ring's teeth by the greatest common divisor of the ring and wheel teeth. A 96-tooth ring with a 40-tooth wheel has 96 ÷ 8 = 12 lobes.
Why does the curve take several turns to close?
The wheel only returns to its exact starting position when whole numbers of teeth have passed on both gears. That takes wheel teeth ÷ common divisor turns.
What does the pen hole distance do?
It decides how deep the lobes reach. A hole near the centre gives a soft rosette. A hole at the rim gives sharp points, and a hole beyond the rim gives loops.
What is a harmonograph?
A drawing machine with pendulums that move a pen and a table. The pen traces two swings added together, which slowly die away, so the line spirals inwards.
Why does my harmonograph never close?
Damping makes each swing a little smaller, so the line never returns to its own path. It is an ever-shrinking spiral.
Next you might need
More in Math & numbers
- Percentage calculator, private, runs on your device
- Area of shapes, private, runs on your device
- Confidence interval calculator, private, runs on your device
- Correlation and regression calculator, private, runs on your device
- Descriptive statistics calculator, private, runs on your device
- Factorial, private, runs on your device





