Presets
Playback
Incoming swell
Longer waves feel the bottom earlier and bend more; angle controls how obliquely they arrive.
Seabed shape
A shoal acts like a lens: rays converge behind it and the waves there grow taller.
Model checks
The science
Why waves bend
Linear water waves obey the dispersion relation ω² = g k tanh(k h). In deep water the speed is c = gT/2π; in shallow water it tends to √(g h). Where one part of a crest is in shallower water it slows down, so the crest turns toward the shore. In a medium with varying speed the rays obey dθ/ds = (1/c)(sinθ ∂c/∂x − cosθ ∂c/∂y), which is Snell's law in a continuous form: on a straight beach sinθ/c stays constant.
Height changes
Energy flux between two rays is conserved, E cg b = const with E ∝ H² and ray spacing b. So H = H0 Ks Kr with shoaling Ks = √(cg0/cg) (Green's law, ∝ h−1/4 in shallow water) and refraction Kr = √(b0/b). A wave breaks when H > 0.78 h. The Iribarren number ξ = tanβ / √(Hb/L0) classifies the breaker as spilling, plunging or surging.
Honest simplifications
The map shows one wave period with linear theory and geometric rays. Rays cannot describe diffraction behind breakwaters or caustics where rays cross, so heights near focus are capped. The breaking limit is a simple depth criterion, there is no energy loss after breaking, no wind, currents or reflection, and the bathymetry is schematic. This is not an engineering tool.
Checks in the page
Check 1 follows a traced ray over a plain beach and tests that sinθ/c stays constant. Check 2 tests the dispersion solver against the deep and shallow limits. Check 3 compares the shoaling ratio from group speed with Green's law.
What to try
- Load Shoal focuses the waves: rays bend toward the shoal's lee, turn red and the waves there grow much taller than at the sides.
- Load Plain beach, oblique swell and watch the crests rotate until they arrive almost parallel to the shore.
- Compare Long ground swell with Short wind sea: the long wave feels the bottom much farther out.
- Steepen the beach and see the breaker type change from spilling toward plunging or surging.