Skip to main content

Playground · Wave Interference

Wave interference

Two ripple sources, overlapping. Where crests meet crests the wave doubles (constructive); where a crest meets a trough they cancel (destructive) — carving out the fan of quiet lines you see here. It's the very same physics behind the double-slit fringes.

Drag either source to move it.

How it's built

Each source emits a circular wave sin(kr − ωt) that fades with distance; the height at every pixel is just the sum of the two — that's the superposition principle. Add them and you get bright bands where they're in phase and dark nodal lines where they're exactly out of phase. Computed per-pixel each frame in vanilla JS on a <canvas>. Shrink the wavelength or widen the sources and the fringes bunch closer — the same relationship that sets the fringe spacing in the double-slit experiment.