2D wave equation with spatially varying speed, demonstrating refraction and Snell's law
This program numerically solves the 2D wave equation on the GPU with a spatially varying wave speed, simulating refraction as a wavefront passes from one medium into another. The change in propagation speed causes the wavefront to bend according to Snell’s law, with partial reflection at the interface. The simulation visualizes the wave amplitude in real time, demonstrating how the geometric optics limit (ray tracing) emerges from the underlying wave dynamics.
Controls: Click and drag to orbit, scroll to zoom.