Visualizations
231 / 500

231 · Fluids

Ship Wake

A boat carves the 19.47 degree Kelvin wake, which emerges from dispersion alone.

Seen from a drone, the sea is linear deep water in which a wave of wavenumber k oscillates at omega = sqrt(g k), stored as a spectrum on a 256 by 128 FFT grid and advanced exactly mode by mode, with a sponge layer outside the frame to absorb outgoing waves. The boat is a moving patch of pressure that kicks every mode at each step, so the wake is the superposition of all the disturbances left along its path. Nothing draws the V: only waves that keep pace with the boat survive, and because their energy travels at half their speed the pattern piles up inside a wedge of half-angle arcsin(1/3), 19.47 degrees, at any speed, with the feathered divergent crests and curved transverse waves of real wakes. Lighting comes from the surface normals (Fresnel sky reflection, light scattered up from the water, fine wind ripples) plus a foam field fed by the propeller.

Try it. Move or drag the pointer to steer the boat toward it. Use the minus and plus buttons or the up and down arrow keys for the throttle, left and right to turn, and K to show or hide the Kelvin wedge. Leave it alone and it runs laps on its own.

  • Exact spectral time stepping
  • Moving pressure source
  • Normal-mapped water shading
  • Pure pursuit autopilot

View the source · one module, plus a small shared runtime for sizing, the animation loop and input

Build your own

Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.

Build a top-down simulation of a boat's wake on deep water with JavaScript and the HTML canvas element, where the famous V-shaped Kelvin wake emerges from the physics instead of being drawn. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.

Start simple:
- Make a canvas that fills the window and stays sharp on high-DPI screens. Keep the water on a 128 by 128 grid that wraps around at the edges, and draw it scaled up.
- Write a small radix-2 FFT. Store the surface height h and its vertical velocity v, and each step transform them to Fourier space. Every wave mode with wavenumber k is a simple harmonic oscillator with frequency omega = sqrt(g k) (deep water), so rotate (h, v / omega) by the angle omega dt, which is exact at any time step, then transform back.
- The boat is a small Gaussian patch of pressure. Each step, kick v down under it, move it a little, and leave the waves to do the rest.
- Shade each pixel from the surface slope (dh/dx, dh/dy): darker blue where the water tilts away from the sun, lighter where it faces it.

Once that works, make it beautiful:
- Damp the waves near the grid edges (a sponge layer) so the wake does not wrap around.
- Light it like a drone photo: a Fresnel reflection of a sky gradient plus a soft blue-green body color, fine noise ripples on top, and a white foam trail behind the stern that slowly fades.
- Let the pointer steer the boat, and draw two dashed lines at 19.47 degrees either side of its track to show that the wake arms line up with them at any speed.

Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as a larger rectangular grid, an autopilot that runs laps, or comparing slow and fast boats to see the visible wake narrow at high Froude numbers.
PreviousFractal TreeA recursive tree that grows, blossoms and sways in the wind. NextDatamoshA real motion-compensated codec, fed a broken stream until the video melts.

Related visualizations

  • Rogue WavesFluids A storm swell where walls of water rise from nowhere through nonlinear focusing.
  • Sailing RegattaPhysics A watercolour yacht race where boats tack upwind because their polars say so.
  • Ocean3D Rolling waves at sunset, built from layered Gerstner waves.
  • Glowing SurfFluids Moonlit waves break on a beach and the plankton in them flash electric blue.
  • Water RipplesFluids Raindrops on a koi pond, with ripples that bend the scene below.
  • Faraday WavesFluids A shaken dish of liquid locks into stripes, squares, hexagons and a 12-fold quasicrystal.
  • SolitonsFluids Solitary waves in a canal pass through each other unchanged, drawn as a Victorian plate.
  • Pool CausticsPhysics Sunlight bent by a rippling pool surface draws a living net of light on the tiles.
  • SPH WaterFluids Thousands of particles that slosh, splash and pour like a liquid.

Use ← and → to move between demos. While the canvas has focus, keys go to the demo instead.

← More from Emergent Mind Labs