Clever Quest Lab ← Labs

Spiral Gears

Roll a toothed wheel round a ring, put a pen in a hole and build layered rosettes.

Drag on the canvas to roll the wheel by hand. Keyboard: Space play/pause, . step one tooth, arrow keys roll the wheel, F finish the curve.

Petals: - · Laps of the ring until it closes: - · gcd: -

Gears

Real-toy tooth counts Rings
Wheels

Pen and paper

Colour

Auto pattern

Auto pattern uses the current gears and pen, steps the chosen setting and moves through the palette. Random picks a pleasant set of gears and starts drawing.

Save and share

The link stores your finished curves (up to 40) in the address, nothing is uploaded. SVG files contain real vector paths.

Presets

How to use it

Press Play and a small toothed wheel rolls round the inside of a fixed ring while a pen in one of its holes draws a curve. A finished curve stays on the paper as a layer, so you can change the gears, pen hole, colour or rotation and draw the next one on top. If you want pictures straight away, open a preset, press Random or let Auto pattern draw a whole rosette.

Controls

How it works

This is a roulette: the curve traced by a point fixed to one curve while it rolls without slipping along another. Let the fixed ring have radius R and the wheel radius r, both proportional to their tooth counts, and let the pen sit at distance d from the wheel centre. Rolling inside gives a hypotrochoid, rolling outside an epitrochoid:

Inside: x = (R − r) cos t + d cos((R − r)t / r),   y = (R − r) sin t − d sin((R − r)t / r)
Outside: x = (R + r) cos t − d cos((R + r)t / r),   y = (R + r) sin t − d sin((R + r)t / r)

Here t is the angle of the line from the ring centre to the wheel centre. With N ring teeth, n wheel teeth and g = gcd(N, n), the curve closes when the same teeth meet again. That takes the least common multiple of N and n teeth, so the wheel goes round the ring n / g times (t runs from 0 to 2πn / g). In that time the pen reaches its outermost points N / g times, which is the number of petals. For N = 96 and n = 36, g = 12, so you get 8 petals and 3 laps. If N and n share no factor, you get N petals and n laps.

A pen on the wheel rim gives a hypocycloid inside and an epicycloid outside. If N = 2n and the pen is on the rim, the curve collapses to a straight line, the Tusi couple. N = 3n gives the three-cusped deltoid and N = 4n the four-cusped astroid. With N = 2n and the pen off the rim you get an ellipse, and a pen at the centre draws a circle.

Such curves are everywhere: the housing of a rotary piston engine is an epitrochoid, and the guilloche patterns on banknotes and watch dials are engraved by machines that combine circular motions.

Things to try

Frequently asked questions

Why does my curve take so many laps to close?

When the tooth counts share a large factor the curve closes quickly. When they are nearly coprime the wheel laps the ring up to n times, because the same teeth only meet again after the least common multiple of N and n teeth.

Why is the drawing almost a circle?

A pen near the wheel centre barely moves relative to the wheel, so it follows the centre, which travels on a circle of radius R − r. Move the hole outwards to see petals.

Why must the wheel be smaller than the ring?

A wheel rolling inside has to fit inside, so n is smaller than N. Outside mode has no such limit.

Can I draw with a pen hole beyond the rim?

Yes, up to 1.5 times the wheel radius. The maths is the same with d larger than r, and the curve gains loops. A real wheel has no holes there.

Is it exactly like a real gear toy?

It is the ideal version, with perfect rolling and no play between teeth. Real drawings differ slightly, but the shapes follow the same equations.

More free games and simulators