Drawing a Closed Curve with Fourier Epicycles

A closed plane curve can be parametrized by a continuous, 1-periodic complex-valued function z(t) = x(t) + iy(t), with z(t + 1) = z(t). For the piecewise-smooth parametrizations used here, z(t) equals its Fourier series:

z(t)  =  Σk = −∞ akeikt,     ak  =  01 z(t) e−2πikt dt.

In this demo, the curve is sampled at N = 511 points zn = z(n/N), equally spaced along its length. The discrete coefficients are ck = (1/N) N−1Σn = 0 zne−2πikn/N for integers k with −255 ≤ k ≤ 255. They approximate the continuous coefficients ak above.

1. The curve and its epicycles

Draw on the left. The right panel shows an M-term Fourier approximation.

Your curve z(t)

presets

Fourier approximation with M = 21 terms

target curve circles |ck| tip of the chain traced approximation

2. Fourier amplitudes |ck|

Highlighted bars are included in the current approximation. A phase is shown as — when the displayed amplitude is 0.00.

#k|ck| (px)arg ckincluded

Back to Collection