Epicycles & Drawing

Draw any shape with rotating circles - the magic of complex Fourier series

The Magic of Rotating Circles

One of the most beautiful applications of Fourier analysis is the ability to recreate any closed curve using nothing but rotating circles. Each circle (or epicycle) rotates at a different frequency, and when you trace the tip of the final circle, the path draws your shape.

This works because the complex Fourier series decomposes your drawing into circular motion: each term c_n e^(inωt) represents a circle rotating at frequency n with radius |c_n|.

Draw Your Own Epicycles

Draw any shape on the canvas below and watch as rotating circles recreate your drawing. Try different numbers of circles to see how more circles give better approximations.

Preset Shapes (or draw your own!)

Draw on the canvas to create your own shape, or choose a preset. Watch as rotating circles (epicycles) recreate your drawing through the magic of Fourier series!

The Mathematics

Given a closed path f(t) where t goes from 0 to 1, we compute the complex Fourier coefficients:

c_n = ∫₀¹ f(t) e^(-2πint) dt

Each coefficient c_n tells us about a circle rotating at frequency n:

  • |c_n| (magnitude) = radius of the circle
  • arg(c_n) (phase) = initial angle
  • n (frequency) = how fast the circle rotates

Why Does This Work?

The key insight is that circular motion is the most fundamental form of periodic motion. Any periodic function can be built from circular motions at different frequencies:

Few Circles

Captures the general shape but misses fine details. Like a blurry photo.

Many Circles

Captures sharp corners and fine details. More circles = higher resolution.

Historical Connection

The word "epicycle" comes from ancient astronomy. Greek astronomers like Ptolemy used epicycles (circles upon circles) to model planetary motion. While their geocentric model was wrong, the mathematics they developed is essentially the same as the complex Fourier series - any periodic motion can be decomposed into circular components!