Fourier Epicycle Drawer
Full workspace Draw any shape, or pick one, and watch a chain of spinning circles trace it out. Every circle is one term of a Fourier series: slide from one circle to hundreds and see the drawing sharpen, read the size, speed and phase of each term, see the spectrum and how much error is left, then export a GIF, MP4 or WebM of the circles drawing, a still, an SVG, the coefficients or a page that plays it anywhere.
- Draw, click points or import SVG
- 1 to 1,024 circles
- Live error & energy
- Spectrum & build-up views
- Follow the pen
- Coefficients as CSV & JSON
- GIF · MP4 · WebM · HTML
- Circles
- –
- Error
- –
- Energy kept
- –
- Biggest circle
- –
Export
Everything uses the circles you have now. Videos and the GIF show the circles drawing one full turn, then hold the finished shape.
Using Fourier Epicycle Drawer
Draw a shape and watch a chain of spinning circles trace it, one Fourier term per circle.
- The drawer opens on a music note traced by 40 circles. Press Space or Pause to stop and start the circles.
- Drag the Circles slider (or press the arrow keys) to use fewer or more circles. With one or two the shape is a blob; the error and energy figures in the top-left panel show how close the drawing is.
- Pick Draw and draw with the mouse or a finger, or pick Points and click the corners of a shape. Your first stroke replaces the example; more strokes are joined into one loop.
- Import SVG takes a logo or icon file, or pasted path data, and turns every path into a loop the circles can trace.
- The Circles tab lists each circle: how many turns it makes per loop, which way it spins, its radius and starting angle. Click a row to light that circle up on the canvas.
- The Spectrum tab shows the size of every frequency and a curve of error against circles; click the curve to jump to that many. Build-up shows the drawing with 1, 2, 3, 5, 8… circles side by side.
- Export a still PNG, an SVG, a GIF, MP4 or WebM of the circles drawing, an HTML page that plays the animation anywhere, a build-up PDF, or the coefficients as CSV or JSON.
Example
Load Square and set the circles to 1, 2, 3, 5 and 30. A square only uses frequencies 1, −3, 5, −7… so each new circle adds a corner-sharpening wiggle, and the corners never get perfectly sharp: that overshoot is the Gibbs effect.
Questions & answers
How can circles draw a shape?
Any closed loop can be written as a sum of circles turning at whole-number speeds, each with its own size and starting angle. Add the arms end to end and the tip of the last one traces the loop. The sizes and angles come from the discrete Fourier transform of points around the loop.
Why biggest first?
Sorting the circles by size draws a good likeness with the fewest circles. Choose Slowest first in Settings to see the classic Fourier order, which builds up detail from coarse to fine.
What do error and energy mean?
Error is the average distance between the circle drawing and your shape, as a share of the shape's size. Energy is how much of the total 'size' of all the circles you are using. Both reach 0% and 100% with every circle.
How many circles do I need?
Smooth shapes need few; sharp corners and fine detail need many. In Settings, the error buttons find the fewest circles that keep the error under 5%, 1% and so on.
Can I use the circles in my own code?
Yes. The coefficients JSON lists each circle as turns per loop and a complex number (re, im). Position at time t is the sum of (re + i·im)·e^(2πi·f·t). The HTML export is a working example.
Why does my drawing get a straight line?
The circles always trace one closed loop, so separate strokes are joined end to start with straight jumps, and the loop closes back to the first point.
Help improve this tool
Report a problem or suggest an improvement
Describe the issue without pasting private tool input. Feedback goes to our admin inbox.
