Lab / Experiment
3D Spirograph
Parametric hypotrochoid curves traced by nested rotating circles, rendered with perspective projection in three dimensions. The classic Spirograph toy elevated into a space you can orbit around.
x(t) = (R − r) cos(t) + d cos((R−r)t/r) · y(t) = (R − r) sin(t) − d sin((R−r)t/r) · z(t) = A sin(k t)
drawing
drag to orbit · scroll to zoom
Presets
5
3
2.5
1.5
3
60
x(t) = (R − r) cos(t) + d cos((R−r)t/r)
y(t) = (R − r) sin(t) − d sin((R−r)t/r)
z(t) = A sin(k · t)
R = 5, r = 3, d = 2.5, A = 1.5, k = 3
y(t) = (R − r) sin(t) − d sin((R−r)t/r)
z(t) = A sin(k · t)
R = 5, r = 3, d = 2.5, A = 1.5, k = 3
What’s happening
A hypotrochoid is the curve traced by a point attached to a smaller circle rolling inside a larger circle. The classic Spirograph toy uses this principle — plastic gears with teeth that keep the ratio exact, and a pen hole that traces the curve.
In two dimensions, these curves are governed by two radii (R and r) and a pen offset (d). The ratio R/r determines how many lobes appear. When R/r is rational, the curve closes; when irrational, it never repeats.
This version adds a third dimension: the z-coordinate oscillates sinusoidally as the curve traces, lifting the flat pattern into a 3D ribbon. The amplitude and frequency of this oscillation create helical flowers, toroidal knots, and crown-like structures that exist nowhere in the flat Spirograph world.
The perspective projection maps 3D points onto your screen using a virtual camera. Points farther away appear smaller, creating depth. Orbit the camera to see how the flat spirograph pattern has been folded and twisted through three-dimensional space.
Drag to orbit the camera. Scroll to zoom. Try the presets, then experiment with the sliders.
Related: Spirograph (2D) · Spirograph advanced · Lissajous curves · Harmonograph