Spirograph playground
Choose a shape and let your pen loop.
A pen traces a looping curve as one circle rolls around another.
Loading the playground…
Radii are relative units. Stylized non-circular shapes deform the curve rather than simulate physical gears; PNG exports have a white background.
How it works
Inside rolling uses a hypotrochoid: x = (R − r) cos(t) + d cos((R − r)t/r), y = (R − r) sin(t) − d sin((R − r)t/r). Outside rolling uses an epitrochoid: x = (R + r) cos(t) − d cos((R + r)t/r), y = (R + r) sin(t) − d sin((R + r)t/r). R is the fixed circle radius, r the rolling circle radius, and d the pen distance. Integer radii let the pattern close after r/gcd(R, r) revolutions. Oval patterns scale y by 0.6. Rounded triangle, square, and star patterns scale both coordinates by (1 + a cos(n(atan2(y, x) - pi/2))) / (1 + a), with n = 3, 4, or 5 and a = 0.12 for rounded shapes or 0.3 for stars. These deformations preserve closure.
Worked examples
Typical task
With fixed radius 120 and rolling radius 40, gcd(120, 40) is 40, so a circular pattern closes after 40 ÷ 40 = 1 revolution of the parameter.
A different case
With fixed radius 100 and rolling radius 30, gcd is 10 and closure takes 30 ÷ 10 = 3 revolutions. Increasing animation speed changes drawing time, not that geometry.
Instructions, limits, and common questions
Instructions
- Choose a Pattern shape. Non-circular options reshape the classic curve and its guides; these are stylized patterns rather than simulations of physical non-circular gears.
- Choose whether the smaller circle rolls inside or outside the fixed circle.
- Adjust the two circle radii and pen distance to change the preview. Radii and distance are relative units, not pixels.
- Choose a line color or turn on Rainbow lines. Select Draw to animate; use Pause and Resume as needed.
- Use Finish instantly to see the complete pattern, Clear to empty the canvas, and Save PNG to download the current drawing.
Limits and assumptions
Fixed radius: 60–200; rolling radius: 10–150 and smaller than the fixed radius; pen distance: 0–200. Changing geometry or colors replaces the drawing with a complete preview. Speed controls only animation timing; at 1× a full drawing takes about 20 seconds, and at 4× about 5 seconds. Shape guides are not saved. PNG files are 1200 × 1200 pixels with a white background; unfinished drawings can also be saved. No settings or drawings are stored or sent by this tool. Animation starts only on request, pauses when the tab is hidden, and finishes instantly when reduced motion is preferred.
Does faster drawing change the final pattern?
No. Speed changes animation timing only. Geometry or color changes replace the preview.
Can I save an unfinished drawing?
Yes. Save PNG captures the current drawing. Use Finish instantly first if you want the complete pattern.
Are the guides included in the download?
No. Shape guides are excluded from the 1200 × 1200 PNG export.
