Polar & Fourier Curves
Fourier series N=40
Bounded numerical curves. Cosine a₀ adds to the constant term.
polar_fourier keeps harmonics through N = 40. The cosine coefficients are aₙ = 1/(n+1). The radius is constant + Σ aₙ cos(nθ) from n = 0 to N, plus the sine sum from n = 1. a₀ = 1/(0+1) is included, and because cos(0) = 1 it shifts the whole radius. The sine coefficients stay at the default 0, so only the cosine family shapes the radius.
The coefficients shrink like 1/(n+1). Harmonic 1 is half the size of a₀, and the last harmonic is the smallest wiggle at this N. Raising N from this value adds those next terms without changing the formula for aₙ.
Equation
polar_fourier(N=40, coefficients=1/(n+1))
Graph preview
What the Fourier sum is doing
A Fourier pattern builds a complicated shape from simple waves. For a polar Fourier curve, the radius is a constant plus a cosine sum from n = 0 and a sine sum from n = 1. The cosine coefficient a₀ is an extra constant, added on top of the constant parameter, because cos(0·θ) is 1.
A larger N keeps more harmonics. Early terms decide the broad shape. Later terms are usually smaller and add finer wobble. The same idea appears in the ordinary sum y = Σ cos(nx)/n, whose infinite form is −ln|2 sin(x/2)| away from multiples of 2π.
Reading the input
polar_fourier(N=40, coefficients=1/(n+1))— This is a command. The name selects the routine, and the items inside the parentheses are its arguments.
Try a change
- Cut N in half and generate again. The broad shape stays and the fine wobble disappears.
- Change a coefficient formula from 1/(n+1) to 1/(n+1)^2. The extra harmonics become much smaller.
Generate Graph posts the expression to the studio graph engine and draws the result on the homepage. The editable field is the entire input, including every line.