Fourier Epicycles
Draw any shape and watch a chain of spinning circles redraw it with a Fourier series.
Draw any closed shape on the canvas and the circles will learn to redraw it. Each circle spins at its own frequency; together they retrace the shape.
How is Fourier Epicycles working for you?
About Fourier Epicycles
Good for: Late at night
Fourier Epicycles turns any closed drawing into a chain of spinning circles. Draw a shape (or pick a preset like a heart, star or butterfly), and the tool samples it as a sequence of points in the complex plane, computes its discrete Fourier transform, and animates the result: each frequency becomes a circle rotating at its own speed, mounted on the tip of the previous one, and the pen at the end of the chain retraces your drawing.
With only a few circles you see the rough outline; add more and the sharp corners and small details snap into place. That is the Fourier series in action — the idea, going back to Joseph Fourier in the early 1800s, that any periodic signal can be built from sines and cosines. The circles are sorted from largest to smallest, so the biggest contributions come first.
Adjust the number of circles, the speed and trail, toggle the circles and radius lines, and export the reconstructed curve as a PNG or SVG, or record one full loop as a video or GIF.
How to use Fourier Epicycles
- Choose or draw a shape. Pick a preset shape, or drag one continuous closed stroke anywhere on the canvas and the circles switch to redrawing your shape.
- Set the number of circles. Use Circles to choose how many Fourier terms are used. Few circles give a smooth approximation; many reproduce the details.
- Watch the epicycles. Change Speed and Trail length, and toggle Show circles to see or hide the rotating chain.
- Export. Export the current frame as PNG, the reconstructed curve as SVG, or record a full loop as a video or GIF.
Frequently asked questions
What are Fourier epicycles?
Epicycles are circles rolling on circles. Each term of a complex Fourier series is a circle with a fixed radius rotating at a whole-number frequency; chaining them tip to tip and following the last tip traces any closed curve.
Why do more circles make the drawing more accurate?
Each extra term adds a higher-frequency component. Smooth shapes are described well by a few large circles, while sharp corners need many small, fast circles — which is why squares and stars converge more slowly than hearts and flowers.
How is the drawing converted to circles?
Your stroke is resampled to 512 evenly spaced points, treated as complex numbers x + iy, and transformed with the discrete Fourier transform. Each resulting coefficient gives one circle's radius (its magnitude) and starting angle (its phase).
Can I use the result for teaching?
Yes. The tool is free with no sign-up, and the animations and exported images can be used in lessons, videos and presentations.
Can I leave it running at night?
Yes. Pick a shape and raise Loop time so the circles turn slowly, then press Full screen and lower the screen brightness. The drawing repeats every loop and makes no sound.





