Saw Cascade

Wave · y = f(x, t)

y = atan(tan((x − t)/2)) · 1.2

Open in the app The dials and keys named below are the app's.

What it draws

This one is a sawtooth: a straight ramp that climbs, drops vertically, and climbs again. The trick is atan(tan(u)). The tangent has period π and its inverse only ever answers between −π/2 and π/2, so the pair together returns u folded into that window: the identity function with a fresh start every π.

Feeding it u = (x − t)/2 stretches one tooth to 2π ≈ 6.28 in x, so two teeth show across ±6. The ramp climbs with slope 1.2/2 = 0.6, and the drops at x − t = ±π, ±3π, … fall the full 3.77 from 1.885 to −1.885. Because x and t appear only as x − t, the whole pattern slides right at one unit per second at Speed 1, teeth and cliffs together.

All the harmonics at once

A sawtooth is the standard example of a Fourier series that needs every harmonic. Writing θ = x − t, the curve is 1.2·sin(θ) − 0.6·sin(2θ) + 0.4·sin(3θ) − …, with the nth term at amplitude 1.2/n and alternating sign.

Those coefficients die off only as 1/n, which is what a jump costs. A sum cut short overshoots the corner by nine percent of the jump and keeps overshooting however many terms are added, the Gibbs phenomenon. Each harmonic has wavenumber n and frequency n, so all of them travel at n/n = 1. Nothing outruns anything else, and that is why the cliff stays a cliff instead of smearing into ripples.

Try

  • Front in the deck for the ramp and its cliff as an oscilloscope would show them.
  • Build it from its harmonics instead: sin(x − t)·1.2 − sin(2(x − t))·0.6 + sin(3(x − t))·0.4. Three terms already lean like the ramp, and they ring hardest right at the cliff.
  • Widen the tooth to 3π ≈ 9.42 with atan(tan((x − t)/3))·1.2: a gentler slope of 0.4, the same height.
  • Send it the other way with atan(tan((x + t)/2))·1.2.
  • Top in the deck: the cliffs become straight diagonal creases through the ribbon, and their slant is the speed.

Read more

Wave · y = f(x, t)