Simplified Ocean Wave Dynamics (2D): Wave Refraction, Headland Focusing and Breaking
The plan view of the same refraction field: depth-shaded seabed, crests from the ray phase, surf where the wave breaks, wave rays coloured by the height ratio H/H0, and a vertical section along one ray that shows the seabed, the wave envelope and the breaking depth.
See why ocean waves turn toward the beach and why some stretches of coast get bigger waves than others. Wave rays are traced over a two-dimensional seabed using the finite-depth phase speed c(h) from omega^2 = g k tanh(kh): where the water shoals the rays bend toward the shallow side (Snell's law for waves), the energy flux in every ray tube is conserved so the wave height follows H/H0 = Ks Kr, and the crests are drawn from the integrated ray phase so they bend, converge on an offshore shoal or a headland, spread out over a submarine canyon and break as surf when H reaches 0.78 times the local depth. Choose the seabed, wave period, offshore height, direction and beach slope, and read the height at three wave buoys, the breaking depths and the height along the shore. A Blender lighthouse, pier, rocks, hut and wave buoys sit on the coast. Numerical checks: Newton against bisection for the dispersion relation, the Snell invariant along a traced ray, the ray direction at depth, Ks Kr against the analytic plane-beach values, the breaking depth, time reversibility, Fermat's least-time property and the energy flux across a transect.
The plan view of the same refraction field: depth-shaded seabed, crests from the ray phase, surf where the wave breaks, wave rays coloured by the height ratio H/H0, and a vertical section along one ray that shows the seabed, the wave envelope and the breaking depth.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install