ReproducibleExample

Square wave, six terms

CG-0165-6885-2819

Six odd harmonics chained as epicycles, tracing a square wave with visible Gibbs overshoot.

Artist
Colors Gravity (example)
Created
2026-11-17
Medium
Algorithmic drawing, HTML canvas 2D
Collection
Fourier
Algorithm
Fourier epicycles (open in studio)

Why it looks like this

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.

Terms N
6
Time t (cycles)
0.3
Seed
0 (not used by this algorithm)

Provenance

  • ✓ID matches the recipe hash.
  • ✓Algorithm source is the registered version.
  • ✓Signed with key e63de6aa3cd0fd53 (ed25519) on 2026-11-17.
  • ✓In the public hash log as entry 2.
Record hash and recipe
record_sha256 13d57d9566c1e8b4b5d48f9f5ed791a30e9a8b896fc53342597e336147469fdc
{
  "algorithm": "fourier-epicycles",
  "params": {
    "phase": 0.3,
    "terms": 6
  },
  "seed": 0,
  "source_sha256": "f248b97f6210f6953145e66f776c7c1e79dfa37bfe501b81dbfdc7a38d85b27c",
  "spec": "cg-recipe/1"
}
JSON record

Verify in your browser

Recomputes the ID from the recipe, checks the algorithm source is the registered one, then re-renders at 480 × 480 and hashes the pixels.