Copie de Spirograph Simulator

A Spirograph kit comes with two outer rings, one with 96 teeth and one with 105 teeth. In addition, there are gears with 24, 30, 32, 36, 40, 42, 45, 48, 50, 52, 56, 60, 63, 64, 72, 75, 80, and 84 teeth. In the simulation below, you are able to choose any value up to 105 for n (the number of teeth on the outer ring); the value of m (the number of teeth on the rolling circle) can then vary from 1 to n. The value of r can be set anywhere from 0 to the radius of the rolling circle. Click the button to see the rolling circle. The tracing point (the tip of our "pencil") is shown in red.
The number of teeth between adjacent points is d = (m,n) (the greatest common divisor of m and n), while the number of points is n/d.