Spirograph playground

Choose a shape and let your pen loop.

Shapes, speed, and colors
The circle that stays in place.
Smaller than the fixed circle.
Can reach beyond the rolling circle.
Changes the pace, not the shape.

Circle sizes and pen distance use relative units. Changing the shape or color redraws the preview.

Spirograph patterns require JavaScript and canvas support.

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

  1. 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.
  2. Choose whether the smaller circle rolls inside or outside the fixed circle.
  3. Adjust the two circle radii and pen distance to change the preview. Radii and distance are relative units, not pixels.
  4. Choose a line color or turn on Rainbow lines. Select Draw to animate; use Pause and Resume as needed.
  5. 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.

References

Continue with a related task