How Fourier epicycles work
How do rotating circles draw a heart? A plain explanation of epicycles, complex Fourier series and the discrete transform, with no heavy prerequisites.
The idea in one picture
Imagine a small circle whose centre sits on the edge of a bigger circle that is itself spinning. A point on the edge of the small circle then follows a path that is neither of the two circles, but a mixture of both rotations. Add a third circle on the edge of the second, a fourth on the edge of the third, and you get a chain of arms, each turning at its own constant speed. The tip of the last arm can draw surprisingly complicated curves.
The remarkable fact is the reverse: any closed curve you can draw in one stroke can be reproduced by such a chain, provided you pick the right radii, speeds and starting angles. That statement is a consequence of the work of Joseph Fourier, who studied how to decompose a periodic function into simple waves in the early nineteenth century.
Describing a shape with one complex number
A point of the plane can be written as a complex number z = x + i y. As you trace an outline, the point moves, so we can write z(t) = x(t) + i y(t), where t goes from 0 to 2 pi and the outline closes on itself, which makes the function periodic.
A circle of radius a turning at a steady speed is simply a e^(i t) multiplied by a phase, where e^(i t) = cos t + i sin t. A circle that turns k times per period is e^(i k t), and k may be negative, which means turning the other way. So the family of building blocks is: circle number k has a radius, a starting angle and k turns per period. The Fourier series claims that z(t) is the sum over k of c_k e^(i k t), where each c_k is a complex number whose modulus is the radius and whose argument is the starting angle.
Finding the circles: the coefficients
The coefficients are given by c_k = (1 / 2 pi) times the integral over one period of z(t) e^(-i k t) dt. The integral works like a test of how much of the shape turns at speed k: multiplying by e^(-i k t) cancels a rotation at speed k and leaves a constant, whose average is the coefficient, while all other rotations average to zero.
On a computer, the outline is not a formula but a list of M points. The integral becomes a sum and we obtain the discrete Fourier transform: c_k is the average of the points multiplied by the matching rotation. The generator on this site follows this approach. It samples the chosen shape, computes the coefficients, sets aside the term for k = 0, which is simply the centre of the figure, and sorts the remaining circles by decreasing radius.
Why a few circles are enough, and why corners cost more
If you keep only the N largest circles, you obtain the best possible approximation of the curve in the least-squares sense. The squared error is the sum of the squares of the radii you removed, a relationship known as Parseval's identity. That is why sorting by size works: the biggest circles carry most of the energy of the shape.
Smooth curves have rapidly decreasing coefficients, so a handful of circles looks right. A corner is different. Near a sharp angle, the curve changes direction abruptly, and many small circles are needed to reproduce it. With too few, the corners round off and the contour wobbles slightly around the true line, an effect close to the Gibbs phenomenon. A heart, with one cusp and one dip, is recognisable quickly; a star with five points needs more, and a letter with straight strokes and sharp ends needs the most.
From epicycles in the sky to epicycles on screen
The word epicycle comes from Greek astronomy. Hipparchus and later Ptolemy explained the sometimes backward-looking motion of planets, as seen from Earth, with circles carried on circles. The model matched observations well because a chain of circles can imitate nearly any periodic motion, as the Fourier argument shows, and not because planets really ride on circles. Heliocentric models with elliptical orbits replaced it as a physical explanation.
Today the same construction is a way of drawing and a way of understanding signals. The same maths sits under audio compression and image processing: keep the biggest coefficients, drop the rest, and you store a signal with less data. A drawing made of 20 circles is a tiny compression of a shape.
Turning it into a short video
The animation has a natural story: it can start with one circle, which only draws a circle, then use two, four and eight circles and reveal the shape progressively. In the generator, this is the option that increases N by doubling at each stage, and each stage plays a note.
To keep a video interesting, show the circles and the trail at the start, choose a shape the audience recognises, and write a short hook that promises the finale. Change the shape and the scale between uploads.
Frequently asked questions
- Do I need to know complex numbers to understand this?
- Only the idea that a complex number is a point in the plane and that multiplying by e^(i t) rotates it. The rest follows from adding rotations.
- Why does the drawing wobble with few circles?
- A finite number of circles can only approximate corners. The missing small circles are exactly what would sharpen them.
- Can any drawing be made with epicycles?
- Any closed curve that can be traced continuously can be approximated as closely as you like, if you allow enough circles.

