What is this?
This demo shows a shape being redrawn by a chain of rotating circles, also called
epicycles. The orange dot is attached to the last circle. As all circles rotate
at their own speeds, the dot traces the selected shape.
The surprising idea is that almost any closed 2D drawing can be described as a sum of circular
motions. Smooth curves usually need only a few circles. Sharp corners, jumps, and disconnected
strokes need many smaller, faster circles.
In simple terms: Fourier analysis is a way to say, "What simple waves are hiding inside this
complicated shape?" Epicycles turn those waves into visible rotating arrows.
The math behind it
A 2D drawing can be treated as one complex-valued signal. Instead of writing a point as
(x, y), write it as:
z(t) = x(t) + i y(t)
The DFT represents the sampled path as a sum of complex exponentials:
ck = (1 / N) Σj=0N-1 zj e-i 2πk j / N
This asks: "How much does the drawing match a circle that spins k times per loop?"
z(t) ≈ Σ Ak ei(k t + φk)
Reconstruction adds the strongest circles back together, where
Ak is radius and φk is starting angle.
Euler's formula, eiθ = cos(θ) + i sin(θ), is why each
term is a circle. The real part moves left/right, the imaginary part moves up/down, and together
they rotate around a center.
Frequency k
How fast the circle spins. Positive and negative frequencies rotate in opposite directions.
Amplitude |ck|
The radius of the circle. Larger amplitudes describe the big outline of the shape.
Phase φk
The starting angle. It decides where a circle begins at time zero.
More epicycles
More Fourier terms. This improves detail, especially around corners and abrupt changes.
Why corners need more circles
A smooth curve changes gradually, so low frequencies capture it well. A sharp star corner changes
direction suddenly. Sudden changes contain high frequencies, so the slider needs more epicycles to
reproduce them cleanly.
If only a few high-frequency terms are used, corners may overshoot or ripple. That is the same
Fourier behavior behind ringing artifacts in compressed images and filtered signals.
Simple intuition
Imagine describing a road trip by giving someone a stack of instructions: "walk in this big circle,
while carrying a smaller spinning arrow, while that arrow carries another smaller spinning arrow."
The final fingertip position is the drawing pen.
The largest circles describe the broad movement, like the overall width and height of the shape.
The tiny circles correct the details, like corners, bends, and small wiggles. Moving the slider upward
is like allowing the pen to use more correction instructions.