Ocean Wave Formation & Shoaling (2D)
A side-view cross-section that solves the full finite-depth dispersion relation ω² = gk·tanh(kd) point-by-point along a sloped seafloor, so wavelength, height and speed evolve realistically as a swell shoals from open water toward a breaking shoreline.
Real ocean swell does not shoal uniformly — its speed, wavelength and height all depend on local water depth through the finite-depth dispersion relation ω² = gk·tanh(kd), not the simplified deep-water form ω² = gk used when depth is effectively infinite. This 2D companion solves that full relation numerically at every point along a sloped seafloor: drag the flag marker from open water toward the beach and watch the wave visibly slow down, shorten and grow taller as depth shrinks, exactly the shoaling behaviour the 3D version's height/wavelength/depth controls hint at but don't quantify — until, past a height-to-depth ratio of about 0.78, the readout flags the point where linear theory breaks down and the wave actually breaks.
2D finite-depth wave-shoaling lab: Newton-Raphson solves ω² = gk·tanh(kd) at each point along a sloped seafloor, energy-flux conservation sets local wave height, and a draggable marker reads out depth, wavelength, height, speed and breaking status live.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install