Every pixel is a patch of water surface. Each step, it is pulled toward the average height of its four neighbours and keeps its momentum — that is the whole wave equation, ten lines of code. Walls pin the height to zero, so waves reflect. Glass halves the wave speed (refractive index 2), which is all a lens or a prism really is. The edges quietly absorb energy so the tank behaves like open water.
Switch to Intensity to see time-averaged energy — the interference fringes behind a double slit, the focal point of a lens.
Ring trap is a resonator experiment: a laser-like line source feeds a loop through a tangent inlet. The meter plots the energy stored in the loop as it climbs and saturates, relative to the incoming wave. The door that lets waves in lets them out, so it saturates within a few laps. Then draw a Wall across the inlet mouth to shut the door: the energy climbs without limit; erase the source and it stays trapped forever. Sweep frequency with [ ] to feel the resonances, and raise Damping to play the part of imperfect mirrors. Spiral trap feeds the loop tangentially; Glass ring drops the walls entirely and couples a glass ring to a glass bus through the evanescent field, the way real microring resonators work — step the frequency by 0.0001 there to walk across its comb of resonances.
| 1 · 2 · 3 · 4 · 5 | Wall, Glass, Source, Erase, Poke |
| Drag / right-drag | Paint with tool / erase |
| Space | Pause or resume |
| C | Clear waves, keep the scene |
| R | Reset the current preset |
| I | Toggle intensity view |
| [ ] | Lower / raise source frequency |
| T | Dark / light theme |
| S | Save a PNG snapshot |
| Ctrl/⌘ + / or ? | This help · Esc closes |
Self-contained: one file, no libraries, no network. Press Esc to return to the tank.