About Fourier Circles
Join circles end to end, each one riding on the rim of the one before and turning at its own steady speed, and put a pen on the last. With the right sizes and speeds the pen draws any closed shape you like: a star, a heart, a treble clef, your own scribble. A few circles give a rough sketch; more circles give a sharper drawing; with all 511 the pen goes through every one of the 512 points the shape is marked out with, and curves smoothly between them.
Pick a shape, or draw your own on the paper. DRAW sets the circles turning; HOW MANY chooses how many are used, and you can change it while the pen is moving. ADD CIRCLES adds them one at a time, biggest first, so you can watch the drawing sharpen. The cards under the paper show the same shape with 1, 2, 3, 5, 10, 20, 50 and 511 circles; pick one to use that many.
Keys: Space draws or pauses, A adds circles or pauses that.
THE STORY
Circles riding on circles are an old idea. Greek astronomers explained the wandering of the planets with epicycles, small circles carried round larger ones, and Ptolemy set the system out in the Almagest around 150 AD. It stayed the standard astronomy for well over a thousand years.
Why that works came much later. In 1807 Joseph Fourier told the Institut de France in Paris that the way heat spreads through a solid could be worked out by writing the temperature as a sum of sine and cosine waves. Many doubted that a sum of smooth waves could make a shape with corners, and his book, Théorie analytique de la chaleur, did not appear until 1822. A point going steadily round a circle is a cosine wave across and a sine wave up, so a sum of waves at whole-number speeds is the same thing as a chain of circles: Fourier's series are epicycles in disguise.
The look of this page borrows from the harmonic machines of the 1890s. In 1898 Albert Michelson and Samuel Stratton described an 80-element harmonic analyser: gear wheels made 80 levers rock to and fro at 1 to 80 times a base speed, springs added their motions, and a pen drew the sum on paper. Run one way it built a curve from its waves; run the other it found the waves in a curve. This machine on the page is not a copy of it.
HOW IT WORKS
The shape is spaced out into 512 points along its edge, and each point is treated as a complex number (x across, y up). The discrete Fourier transform turns them into 512 circles: one stays still (the middle of the shape), and the others spin a whole number of times per loop, some one way, some the other. They are used biggest first. Added tip to tip, all of them land exactly on each of the 512 points (between the points the path is a smooth curve, not the shape's straight edges); leave some out and you get the closest path that so many circles can make, measured by squared distance at the 512 points. The figure under the slider is how far, on average, the path is from the shape, as a share of the shape's size.
Some shapes need very few circles. A circle needs one. An ellipse needs two, turning in opposite directions. The ROSE is exactly two, at 2 turns and −1 turn per loop, so with two circles it is perfect and every other circle is empty. Corners are the hard part: a square's circles shrink only as the square of their speed, and a sharp scribble needs hundreds.
The sums here are done the slow way, 512 × 512 multiplications, which a computer finishes in a blink. The fast Fourier transform, published by James Cooley and John Tukey in 1965, does the same job in far fewer steps, and makes Fourier's idea practical in sound, pictures and radio.
Simplifications. A drawing is turned into 512 points joined by straight lines, so very fine detail is lost; a drawing you share as a link keeps 128 of its points. The 512 points are evenly spaced along the outline and the pen reaches them at evenly spaced times, but between them, and with few circles, its speed varies. Real machines had friction, backlash and stretch in their springs; these circles are perfect.
The same maths makes sounds: Sound Waves adds sine waves together on an oscilloscope, and lets you hear them.
FURTHER WATCHING AND READING