Tsunami Travel-Time & Wavefront Map (2D)
2D tsunami lab: a fast-sweeping eikonal solver computes real travel time across a bathymetry map (deep ocean, continental shelf, seamount) from c=√(g·h), while Green's Law sets shoaling amplitude — watch the wavefront bend around the seamount and race the ETA countdown to the coast.
The 3D original drives its ocean surface off two decorative sliders (a labelled "bottom shift" and "ocean depth" with no computed relationship between them). This 2D companion replaces that with the real method tsunami warning centers use to publish an ETA: a Fast Sweeping solver for the eikonal equation |∇T|·c(x,y)=1, where c=√(g·h) comes from an actual depth map — a deep-ocean basin, a shoaling continental shelf, and a fixed seamount that visibly refracts the wavefront as it passes. Amplitude at any point comes from Green's Law (energy-flux conservation under shoaling) combined with cylindrical geometric spreading from the point source, so the leading pulse genuinely grows as it climbs the shelf. Every control — bottom shift, epicenter distance from coast, deep-ocean depth, shelf width — rebuilds the depth field and re-solves the travel-time grid, and the ETA/front-speed readouts are read directly out of that solve.
Fast Sweeping Method on a 150×78 grid: four alternating sweep directions, Godunov upwind stencil T = min(a,b)+f·dx (or the two-sided quadratic solution when the finite-difference discriminant is positive), converging the travel-time field T(x,y) in five passes. Wave speed c(x,y)=√(g·h(x,y)) from a smoothstep bathymetry profile (deep ocean → shelf → 15 m coastal reference depth) plus a Gaussian seamount that locally shoals the bed by up to 78%. Displayed wave height = A₀·(h₀/h)^0.25·√(r₀/r)·envelope(t−T), i.e. Green's Law shoaling × cylindrical spreading × a rise-then-decay pulse envelope keyed to a stored 18-minute period — verified by construction: front speed always equals √(g·h) at the front's own depth, and the front only ever advances where the elapsed time has crossed the solved T(x,y).
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install