# Spirograph > How do you draw a spirograph that closes? Set the gears or the pendulums and see the curve at once: spirograph rosettes and harmonograph spirals, from the numbers you choose. Draw spirograph and harmonograph curves from gear teeth or pendulum frequencies. See how many turns close the curve and how many lobes it has. - Page: https://how.box/spirograph/ - Runs entirely in the browser. - License: HowToolbox's own text and data (titles, explanations, FAQs, tool descriptions and schemas, this file) are CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); AI training and answers are welcome. Attribute "HowToolbox (how.box)" with a link to the page used. Third-party data keeps its own terms; the name and logo are not licensed. Publisher: HowToolbox, contact@how.box. Terms: https://how.box/about/terms/ ## Inputs Answer link: https://how.box/spirograph/?m={m}&o={o}&i={i}&p={p}&r={r}&a={a}&b={b}&c={c}&d={d}&t={t}&f={f}&s={s} - `m` (spirograph or harmonograph): The machine: spirograph or harmonograph. Example: `spirograph`. - `o` (whole number 20 to 150): Teeth of the fixed ring gear. Example: `96`. - `i` (whole number 5 to 100): Teeth of the rolling wheel. Example: `40`. - `p` (number 1 to 150): Pen hole distance from the wheel centre, in teeth. Example: `28`. - `r` (inside or outside): The wheel rolls inside or outside the ring. Example: `inside`. - `a` (whole number 1 to 6): First sideways pendulum frequency. Example: `2`. - `b` (whole number 1 to 6): Second sideways pendulum frequency. Example: `3`. - `c` (whole number 1 to 6): First up-down pendulum frequency. Example: `3`. - `d` (whole number 1 to 6): Second up-down pendulum frequency. Example: `2`. - `t` (number 0 to 0.1): Small extra frequency of the last pendulum. Example: `0.01`. - `f` (number 0.03 to 0.5): How fast the swings fade, per swing. Example: `0.05`. - `s` (number 0 to 360): Start phase of the first pendulum in degrees. Example: `90`. Example answer: https://how.box/spirograph/?m=spirograph&o=96&i=40&p=28&r=inside&a=2&b=3&c=3&d=2&t=0.01&f=0.05&s=90 A complete link carries the primary answer in the page HTML; a missing or invalid value shows the default page. ## Agent tools - `spirograph_calculate`: Spirograph or harmonograph curve. - MCP, one POST to https://how.box/mcp: `{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"spirograph_calculate","arguments":{"mode":"spirograph","outer":96,"inner":40,"pen":28,"roll":"inside","freq_a":2,"freq_b":3,"freq_c":3,"freq_d":2,"detune":0.01,"damping":0.05,"phase":90}}}` - GET: https://how.box/mcp/run/spirograph_calculate?mode=spirograph&outer=96&inner=40&pen=28&roll=inside&freq_a=2&freq_b=3&freq_c=3&freq_d=2&detune=0.01&damping=0.05&phase=90 ## How it works A spirograph pen sits in a hole of a small wheel that rolls round the inside of a ring. Every tooth that passes the ring turns the wheel a little, and the pen traces a rosette. The wheel returns to its start only when whole numbers of teeth have passed, so the curve closes after the wheel has gone round enough times, and the shape has as many lobes as the teeth share in common. With a ring of R teeth, a wheel of r teeth and the pen d teeth from the wheel's centre, the pen is at x = (R − r) cos t + d cos((R − r) t ÷ r) and y = (R − r) sin t − d sin((R − r) t ÷ r). Let g be the greatest common divisor of R and r. The curve has R ÷ g lobes and closes after r ÷ g turns. For example a 96-tooth ring and a 40-tooth wheel give g = 8, so 12 lobes after 5 turns. A harmonograph adds two sine waves for each axis, each fading with time, so the pen spirals inwards. Whole-number frequencies close the shape and a small detune makes it turn slowly. The pen hole distance changes the look: near the wheel's centre the curve is gentle, near the rim it grows loops, and beyond the rim the loops are large. The picture is idealised: real plastic gears slip a little and real pens leave a line of some width. ## FAQ **How many lobes does my spirograph have?** Divide the ring's teeth by the greatest common divisor of the ring and wheel teeth. A 96-tooth ring with a 40-tooth wheel has 96 ÷ 8 = 12 lobes. **Why does the curve take several turns to close?** The wheel only returns to its exact starting position when whole numbers of teeth have passed on both gears. That takes wheel teeth ÷ common divisor turns. **What does the pen hole distance do?** It decides how deep the lobes reach. A hole near the centre gives a soft rosette. A hole at the rim gives sharp points, and a hole beyond the rim gives loops. **What is a harmonograph?** A drawing machine with pendulums that move a pen and a table. The pen traces two swings added together, which slowly die away, so the line spirals inwards. **Why does my harmonograph never close?** Damping makes each swing a little smaller, so the line never returns to its own path. It is an ever-shrinking spiral. More: [HowToolbox index](https://how.box/llms.txt) · [Agent Skill](https://how.box/skill.md) · [agent terms](https://how.box/about/agents/)