The sea surface is a sum of five real sinusoidal wave components, weighted into a Pierson–Moskowitz-style peak around the period the wind would build: Tp = 2πU / (0.855g). Each component's wavenumber k is solved from the exact linear-wave dispersion relation — not the deep-water shortcut — at every point along a sloping seafloor that shallows from 50 m offshore to the depth you set at the shore:
ω² = g·k·tanh(k·h)
c = ω / k (phase speed)
Cg = 0.5·c·(1 + 2kh / sinh(2kh)) (group speed)
Ks = √(Cg,offshore / Cg,local) (shoaling coefficient)
As each component's Cg drops in shallower water, its local amplitude grows by the shoaling coefficient Ks — real energy-flux conservation, not a scripted height increase. When the resulting local wave height exceeds about 0.78×depth (the standard breaking criterion), the crest is marked as breaking and shown with foam. The floating buoy's orbit is drawn from the same k and depth: in deep water the orbit is circular, but as kh shrinks the horizontal excursion (∝ coth(kh)) grows relative to the vertical one — the flattened, elliptical orbit real buoys trace in shallow water.
- Left pane — live cross-section from deep water to shore, with the buoy riding the combined surface.
- Top-right pane — the five-component amplitude spectrum by period.
- Bottom-right pane — depth h(x) versus the locally shoaled significant height, with the breaking threshold shaded.