Spirograph Generator
Draw classic spirograph curves — hypotrochoids (inner rolling) and epitrochoids (outer rolling) — by adjusting the fixed circle radius R, the rolling circle radius r, and the pen offset d. The curve auto-closes after the fewest whole revolutions, and you can download the result as an SVG. Everything is computed and rendered locally in your browser.
A hypotrochoid traces a point fixed inside a circle of radius r rolling inside a fixed circle of radius R: x = (R−r)·cos t + d·cos((R−r)/r·t), y = (R−r)·sin t − d·sin((R−r)/r·t). An epitrochoid rolls outside: x = (R+r)·cos t − d·cos((R+r)/r·t). The curve closes after r ÷ gcd(R∓r, r) revolutions, so the drawing is always a complete figure. Download gives a scalable SVG with the exact same path. Runs locally.