Wave period T and water depth h are the real inputs; wavenumber k is solved from the full linear-wave dispersion relation by Newton iteration, not looked up from a deep-water shortcut:
ω = 2π/T
ω² = g·k·tanh(k·h) (solve for k)
L = 2π/k c = ω/k
deep water (h/L > 0.5): c ≈ √(g·L/2π)
shallow water (h/L < 0.05): c ≈ √(g·h)
The sea surface is the traveling profile η(x,t) = A·cos(k·x − ω·t). The board is treated as a bead constrained to that curve — its horizontal equation of motion comes straight from differentiating the constraint y=η(x,t) and projecting gravity onto the local tangent:
slope s = ∂η/∂x = −A·k·sin(k·x − ω·t)
a_gravity = −g·s / (1 + s²) (exact tangential component)
a_drag = −Cd·v·|v|
v += (a_gravity + a_drag)·dt ; x += v·dt
Trim doesn't move the board directly — it changes the effective contact angle the rider presents to the face (edging), which is added to the real slope before the projection above, so steeper trim converts more of the wave's height into forward acceleration at the cost of extra wetted-area drag.
The pocket is found from the board's phase inside the wave's own moving frame, θ = k·x − ω·t, wrapped to (−π, π]. Its rate of change is exactly k·(v − c) — the relative velocity between board and wave — so:
dθ/dt = k·(v_board − c)
pocket: θ near the steepest push point (π/2)
v < c persistently → θ drifts toward the trough → falling behind
v > c persistently → θ drifts toward the crest/flat → pearling
- Wave height H — sets amplitude A=H/2, which scales the slope and how hard gravity pulls the board down the face.
- Wave period T — sets ω; longer-period swell carries more energy and (with the same depth) a longer, faster wave.
- Water depth h — moves k·h through the tanh term, shifting the wave from deep-water (dispersive, c depends on L) to shallow-water (non-dispersive, c=√(gh)) exactly as real surf breaks do as swell reaches shore.
- Trim — the only thing you control directly; everything else follows from the equations above each frame, so falling out of the pocket is a real dynamical outcome, not a scripted event.
Vertical drawing scale is exaggerated for legibility; the physics (slope, phase, velocities) always uses true metres and seconds.