Spirograph advanced
A three-gear spirograph with visible mechanics. Watch nested gears rotate and trace hypotrochoid and epitrochoid curves in real time. The pen point on the inner gear draws mathematical curves that range from simple circles to complex multi-lobed patterns.
x(t) = (R−r)cos(t) + d·cos((R−r)t/r) y(t) = (R−r)sin(t) − d·sin((R−r)t/r)
Hypotrochoids and epitrochoids
A hypotrochoid is the curve traced by a point on a circle rolling inside a larger circle. An epitrochoid is the same, but with the smaller circle rolling outside. The classic Spirograph toy produces hypotrochoids. The shape depends on three parameters: the fixed ring radius R, the rolling gear radius r, and the pen distance d from the gear center.
Three-gear system
This advanced version adds a second gear rolling inside (or on) the first. The pen is attached to the second gear, producing curves of far greater complexity. When r2 is zero, you get the classic two-gear spirograph. Increase r2 and d2 to enter unexplored territory.
Mathematical connections
Special cases produce famous curves: a cardioid (r = R/2, d = r), an astroid (r = R/4, d = r), a deltoid (r = R/3, d = r), and n-petal rose curves when R/r is an integer. The curve closes after r/gcd(R,r) full rotations of the gear.