Fourier Epicycles illustration

Fourier Epicycles

Any closed path can be rebuilt from rotating circles (epicycles) whose radii and speeds come from the discrete Fourier transform of the path. Draw a closed curve with the mouse, or pick a preset shape — a star, a heart or the letter π — and the tool computes its DFT and animates a chain of circles, each turning at an integer frequency, whose tip traces out the reconstruction next to your original drawing. A slider sets how many terms (circles) to use, so you can watch a handful of circles already capture the rough shape and each extra one add finer detail. Play, pause, clear and redraw.

Runs 100% in your browser — simulations are computed locally on your device.

Notes

  • The path is treated as a list of complex numbers; the discrete Fourier transform turns it into circles with a radius, phase and integer rotation speed each.
  • Circles are drawn largest first; adding terms improves the fit, and with as many terms as points the trace is exact.
  • Sharp corners need many high-frequency terms — a few low frequencies already give a smooth approximation of the overall shape.
  • Runs 100% in your browser — simulations are computed locally on your device.