Fourier transform
Every shape is a sum of waves
1. Waves add up
A sine wave is the smoothest possible wiggle. Each slider below controls one sine wave, and the dark line is their sum. Waves with more cycles are the faster wiggles. Try a preset, then watch what happens when you add waves one at a time.
Thin colored lines are the individual waves. The dark line is their sum. The dashed grey line is the ideal shape of the chosen preset.
Strength of each wave (cycles across the view)
2. Taking a shape apart
Now run it backwards. Draw any wiggly line on the canvas, or pick one, and the Fourier transform works out which sine waves add up to it. The slider chooses how many of those waves to keep, starting with the slowest. The bars show how strong each wave is.
Draw on the grey canvas with a mouse or finger. The right edge joins back to the left edge, since the waves repeat forever. A sudden jump therefore needs many waves, and the orange line overshoots near each jump.
3. Circles that draw a picture
The same idea works in two dimensions. Any closed shape can be drawn by a chain of spinning circles, each riding on the end of the one before. Each circle turns at its own steady speed, and the pen sits at the end of the last arm. Draw your own closed shape on the canvas, or pick one, then change how many circles are used.
The faint grey line is the shape you asked for. The orange line is what the circles have drawn so far. Try the star with only a few circles, then add more: corners are the hardest part.