🌀 Spirograph — Hypotrochoid & Epitrochoid Curves
Draw beautiful mathematical curves using spirograph equations. A small circle rolling inside or outside a fixed ring traces intricate symmetric patterns. Explore integer and fractional gear ratios.
Draw beautiful mathematical curves using spirograph equations. A small circle rolling inside or outside a fixed ring traces intricate symmetric patterns. Explore integer and fractional gear ratios.
This tool draws a spirograph, the curve traced by a pen fixed inside or outside a small circle that rolls without slipping around a larger fixed ring. Rolling on the inside produces a hypotrochoid and on the outside an epitrochoid. Each point is computed from the parametric equations as the rolling angle advances, and the symmetry of the finished pattern is governed entirely by the ratio of the outer radius R to the inner radius r.
A circle of radius r rolls inside (hypotrochoid) or outside (epitrochoid) a fixed ring of radius R, with a pen held a distance d from the rolling centre. The point is plotted from x=(R−r)cos t+d·cos((R−r)/r·t) and y=(R−r)sin t−d·sin((R−r)/r·t), with (R−r) replaced by (R+r) in epitrochoid mode. The number of petals equals R divided by the greatest common divisor of R and r.
Toggle between Hypotrochoid and Epitrochoid, or pick a preset such as Astroid, 5-Petal Rose or Golden Ratio. Sliders set the outer radius R, inner radius r, pen distance d, drawing speed, stroke width and hue offset, with live readouts of curve type, petals and rotations to close. Buttons clear the canvas, save the drawing as a PNG, or auto-loop the animation.
When R and r share no common factor, the curve will not close until the rolling circle has made r full trips around the ring, which can produce hundreds of overlapping loops before the pattern finally repeats.
A spirograph curve is the path traced by a pen attached to a small circle that rolls around a larger circle without slipping. If the small circle rolls on the inside of the ring the curve is called a hypotrochoid; if it rolls on the outside it is an epitrochoid. Both are smooth, symmetric parametric curves.
R is the radius of the fixed outer ring, r is the radius of the rolling circle, and d is the distance of the pen from that rolling circle's centre. Changing R and r alters the symmetry and number of petals, while d controls how far the pen reaches, shifting the curve between a near-circle and dramatic looping rosettes.
The pattern closes only after the rolling circle completes a whole number of trips, set by the ratio R to r. When R and r have a large lowest common multiple, or share no common factor, the pen travels many revolutions before returning to its start, so the figure overlaps itself repeatedly before finally repeating.
Yes. It plots the exact parametric trochoid equations rather than an approximation, so the petal count, symmetry and closing behaviour all follow directly from the radii you choose. The displayed petal figure uses the greatest common divisor of R and r, which matches the true geometry of a rolling-circle curve.
A hypotrochoid is traced when the rolling circle stays on the inside of the fixed ring, giving inward, star-like or rosette shapes. An epitrochoid is traced when the circle rolls on the outside, producing outward, flower-like loops. In the equations this is the only change: the term (R−r) becomes (R+r) and the sign of the cosine term flips.