🌐 EN

🎡 Spirograph Generator

Create hypotrochoid spirograph patterns from three numbers: the fixed ring radius R, the rolling gear radius r, and the pen offset d. Adjust color and line width, and optionally animate the drawing.

120
45
70
1.5
GUIDE

Learn more

01

What is a spirograph?

A spirograph is a drawing toy — patented by Denys Fisher in 1965 — that traces hypotrochoid and epitrochoid curves. A small toothed gear rolls inside (or around) a fixed ring, and a pen placed in an offset hole of the gear draws the curve as the gear turns. The interplay of the ring, the gear and the pen position produces the looping, star-like rosettes the toy is famous for.
02

The math (hypotrochoid)

When the gear rolls inside the ring, the pen traces a hypotrochoid given by the parametric equations x = (R − r)·cos θ + d·cos(((R − r)/r)·θ) and y = (R − r)·sin θ − d·sin(((R − r)/r)·θ), where R is the ring radius, r the gear radius, d the pen offset and θ the rolling angle. The pattern closes after r / gcd(R, r) full turns, when the pen finally returns to its starting point.
03

Getting different patterns

The ratio R : r sets how many lobes the pattern has — a larger ring relative to the gear gives more petals. The pen offset d controls the shape: small d stays rounded and near-circular, while d close to r makes sharp, pointed cusps. Try coprime values of R and r (their gcd is 1) to get dense, many-pointed stars that only close after many revolutions.

Frequently asked questions

What do R, r and d mean?
R is the fixed outer ring radius, r is the rolling inner gear radius, and d is the distance of the pen from the gear's centre. Together they determine the shape of the curve.
Why does the curve close into a loop?
The pen returns to its start after the gear makes r / gcd(R, r) revolutions. At that point the rolling motion has come back into phase, so the pattern repeats and closes.
What is the difference from an epitrochoid?
A hypotrochoid rolls the gear inside the fixed ring, while an epitrochoid rolls it around the outside. This generator draws hypotrochoids.