Spirograph (2D)

A fixed outer ring of radius R and a rolling inner circle of radius r trace a hypotrochoid: x=(R−r)cosθ+d·cos(kθ), y=(R−r)sinθ−d·sin(kθ), k=(R−r)/r. Drag the mode switch to trace an epitrochoid instead, where the small circle rolls around the outside of the fixed one. The gears actually rotate at the correct ratio — this isn't a decorative overlay, the pen point comes straight from the rolling-circle position each frame.

Controls

Live characteristics
k = (R−r)/r0
Symmetry (cusps)0
Loops to close0
θ (rad)0
Revolutions of r0
Points drawn0
Path length (px)0
Pen speed (px/s)0