← Studio

Fourier epicycles

f(t) = (4/π) · Σₖ sin((2k−1)·t) / (2k−1), k = 1 … N

A square wave built from circles. Each term of the Fourier series is a circle spinning at an odd multiple of the base frequency, with radius shrinking as 1/k. Chain the circles tip to tail and the last tip traces the sum, drawn as the wave on the right. A few terms already give the square shape; the overshoot at each jump (the Gibbs phenomenon, about 9%) never goes away however many terms you add, it only gets narrower.

source_sha256 f248b97f6210f6953145e66f776c7c1e79dfa37bfe501b81dbfdc7a38d85b27c · lib/algorithms/fourier-epicycles.ts · Fourier

Parameters

This algorithm is deterministic; the seed is recorded but does not change the picture.

Edition ID

…

Not registered. Every parameter set is a distinct edition with its own ID.

{
  "algorithm": "fourier-epicycles",
  "params": {
    "phase": 0.3,
    "terms": 6
  },
  "seed": 1,
  "source_sha256": "f248b97f6210f6953145e66f776c7c1e79dfa37bfe501b81dbfdc7a38d85b27c",
  "spec": "cg-recipe/1"
}