Spirograph — Hypotrochoids & Epitrochoids

Explore parametric rolling-circle curves interactively. A hypotrochoid is traced when a small circle rolls inside a fixed ring; an epitrochoid when it rolls outside. By adjusting the outer radius R, rolling radius r, and pen offset d, you can produce an endless variety of roses, stars, looping petals, and the famous cardioid — all from one simple mechanical principle.

Frequently Asked Questions

What is a hypotrochoid?

A hypotrochoid is a curve traced by a point attached to a small circle rolling inside a larger fixed circle. The parametric equations are x(t) = (R−r)cos(t) + d·cos((R−r)/r · t) and y(t) = (R−r)sin(t) − d·sin((R−r)/r · t), where R is the outer radius, r the rolling circle radius, and d the pen distance from the rolling circle's centre.

What is an epitrochoid?

An epitrochoid is traced by a point on a circle rolling outside a fixed circle. Its equations are x(t) = (R+r)cos(t) − d·cos((R+r)/r · t) and y(t) = (R+r)sin(t) − d·sin((R+r)/r · t). Famous examples include the cardioid (d = r, r = R) and the limaçon.

How does a spirograph toy work?

A spirograph toy uses toothed plastic rings and gears. A smaller gear is placed inside (or outside) the fixed ring, and a pen is inserted in one of the holes. As the gear rolls around, the pen traces a hypotrochoid or epitrochoid. The ratio R/r and the hole position d determine the pattern.

When does a spirograph curve close?

The curve closes after a full period of 2π · r / gcd(R, r) in t, which corresponds to r / gcd(R, r) full rotations of the rolling circle and R / gcd(R, r) trips around the fixed circle. If R/r is irrational the curve never exactly closes and fills an annulus densely.

What is a cardioid and how is it related?

A cardioid is an epitrochoid with r = R and d = r. Its name comes from the Greek word for heart. It appears in many physical contexts: the microphone pickup pattern, the boundary of the main bulb of the Mandelbrot set, and in optics as a caustic in a coffee cup.

What is a rose curve and how do I get one?

A rose curve (rhodonea) appears when d = R − r (the pen is on the circumference of the rolling circle) and r divides R. The number of petals equals R/r if R/r is odd, or 2R/r if R/r is even. Try R = 120, r = 40, d = 80 for a three-petal rose.

What mathematics underpins the spirograph?

Spirograph curves are Fourier epicycles in disguise: each sinusoidal term in the parametric sum corresponds to one harmonic frequency. Hypotrochoids and epitrochoids are also special cases of Roulettes — curves generated by rolling one curve along another — studied by Euler and Bernoulli.

Why does GCD matter for spirograph patterns?

The greatest common divisor (GCD) of R and r determines the curve's period. Only the reduced ratio (R − r)/r matters for the shape. Curves with the same ratio but different absolute radii look identical. A GCD of 1 means the smallest gear must make R revolutions before the pattern repeats.

What happens when the pen distance d is larger than r?

When d > r the pen extends beyond the rolling circle's edge, producing looping or prolate curves with inner loops. For hypotrochoids with d > r the curve can extend outside the fixed ring region. When d = r the curve passes through the centre of the rolling path, and when d < r the curve stays within the annulus between radii |R−r−d| and R−r+d.

Are spirograph curves related to Lissajous figures?

Both are parametric curves with sinusoidal components but differ in structure. Lissajous figures use x = A·sin(at + δ), y = B·sin(bt) with independent amplitudes and frequencies, while spirograph curves couple amplitude and frequency through the rolling geometry. When R/r = 2 the hypotrochoid degenerates into a straight line, a degenerate Lissajous, showing the deep connection.