PHYS·03 Interference — a ripple tank: tap to drop wave sources, the summed field is computed per pixel on a low-resolution buffer and scaled up, warm color lookup table, frequency slider, two-slit preset

Physics Lab · Experiment 03 · wave optics

Waves that argue.

A ripple tank in a canvas. Every pixel sums a sine from each source — where crests agree the water glows bone-white, where they disagree it goes dead still. Tap to drop a source; tap it again to lift it out.

2 sources
scroll
[00]The tank

superposition, computed the honest way

Field
Σ sin(k·d − ωt) per pixel per source — no shortcuts, no sprites, the pattern is arithmetic
Resolution
computed on a small buffer, scaled up with smoothing — with a Nyquist floor: the wavelength never drops below ~6.5 sim pixels, so ripples stay rings, never checkerboard
Falloff
amplitude fades ~1/(1+εd), precomputed per source so the frame loop is one sin() per term
Sources
tap to add, tap again to remove · max 5 — the oldest bows out for the sixth
Palette
256-entry LUT — ink trough → terra midwater → ochre → bone crest
Status
🟢 rippling · reduced-motion freezes the phase, pattern stays
[01]Six ripples

the whole of wave optics, one tap at a time

01 · superposition

Waves just add

Two waves crossing don't collide, negotiate, or bounce — the medium simply sums them and each continues as if the other didn't exist. Everything else on this page falls out of that.

02 · nodes

Lines of dead calm

Where one wave's crest always meets the other's trough, the water never moves. Stillness as evidence.

03 · two slits

The famous experiment

Press the preset: two sources a few wavelengths apart, and the fan of bright and dark bands appears — the same geometry that told us light is a wave.

04 · the LUT

Color is a lookup

The field value indexes a 256-entry table built once — ink to terra to ochre to bone. No per-pixel color math survives inside the hot loop.

05 · falloff

Loud near, soft far

Real ripples spread their energy over a growing circle; here amplitude fades with distance so patterns stay legible.

06 · standing still

Reduced motion, kept meaning

If your OS asks for less motion, the phase freezes at one instant — you still get the full interference pattern as a still photograph, and every tap re-exposes it.

ωt = const
[02]The bench

tap to drop sources · drag one to slide it live · frequency slider retunes the whole tank, hero included

frequency 90
Field note: the first version of this page shipped with a classic bug — wavelength was set in display pixels, so at high frequency it fell to ~2 samples per wave on the sim buffer and the water collapsed into checkerboard moiré. The fix is one idea: define the wavelength in sim pixels and give it a floor. Below ~6.5 samples per wave, a sampled sine stops being a wave. Everything else — the LUT, the precomputed distance tables, drag recomputing once per move — survived untouched.