PathAnimator

How spinning circles draw anything

Fourier series explained one idea at a time, with a live figure at every step.

Your Brand Could Be Here

Sponsor us and feature your banner here. Any user clicking on it will be redirected to your page in a new tab.
Plus, get exclusive sponsor placements across the app.

By Harshith · Updated

A Fourier series writes any repeating shape as a sum of sine waves. Drawn as circles spinning on circles, called epicycles, those waves can trace any closed path. This page shows why that works, one idea at a time. Every figure is live: drag the sliders, click the bars, draw your own shape.

1Waves add up

A sine wave is the smoothest way something can go up and down. Sound, light and the swing of a pendulum all look like this. The useful fact: when you add sine waves together, height by height, you get a new wave with a new shape.

Slow wave: 1.0
Twice as fast: 0.5
Three times as fast: 0.3
Three sine waves (colors) and their sum (white). Every point of the white wave is just the three colored heights added together.

Turn the sliders and watch the white wave change. With only three waves you can already make lumps, plateaus and wobbles.

2Enough waves make any shape

In 1807 Joseph Fourier claimed something bold: any repeating shape can be built by adding sine waves, even a shape with sharp corners like a square wave. You just need the right speeds and the right sizes.

Sine waves used: 3
The dashed line is a perfect square wave. The white line adds up the sine waves 1×, 3×, 5×… as fast, each one smaller. More waves, sharper corners.

Push the slider up and the corners get sharper. Notice the little overshoot right at each jump. It never quite goes away, no matter how many waves you add. It's called the Gibbs phenomenon.

3A circle is a sine wave in disguise

Watch a point on a spinning wheel from the side and its height goes up and down as a sine wave. So a spinning circle and a sine wave are the same thing seen two ways. The circle's size is the wave's height and its spin speed is the wave's speed.

Circles: 1
Each circle spins at one of the speeds from the square wave and has that wave's size. Stack them tip to tail: the height of the last tip, traced over time, is the sum of the waves.

Put the circles tip to tail and the last tip draws the sum of all the waves. That's an epicycle: a circle riding on a circle, the same idea ancient astronomers used to predict the planets.

4From a drawing to circles

A drawing is a path in two directions at once: left and right, up and down. Using complex numbers, the Fourier transform measures the whole path and hands back a list of circles: how big each is, how fast it spins, which way, and where it starts.

The computer measures your drawing with a Fourier transform and turns it into circles, biggest first. The bars below are those circles: height is size, position is speed and direction. Click a bar to remove that circle.

Slide the circle count down to 1 and you get a plain circle. At 2 or 3 it becomes a lopsided loop. Keep going and the shape snaps into focus. Muting a big bar wrecks the drawing; muting a tiny one changes almost nothing.

5Why a few big circles are enough

The circles are sorted biggest first, and the sizes fall off fast. So the first few circles carry nearly all of the shape, and the rest only add fine detail.

Loading…

This is the idea behind compression. JPEG images and MP3 audio use close cousins of the Fourier transform, keep the big parts, and drop the tiny ones you'd never notice. That's how a song fits in a few megabytes.

Teaching this?

Classroom mode puts one shape on a big screen with large type. Step through it one circle at a time with the arrow keys while the class watches it converge. Any animation from the editor can be opened there via Share.

Sources and further reading