TITLE Ripple Tank PROMPT A virtual ripple tank: the classroom apparatus in which waves in a shallow tray of water are lit from above so their crests and troughs project as bright and dark bands. Here it is a real-time 2D wave-equation simulation in WebGL (ping-pong float textures, hand-written shaders) with draggable wave sources and barriers, rendered as shimmering light on a white lab bench. The viewer builds classic experiments: single-slit diffraction, double-slit interference, reflection from a curved mirror, refraction over a shallow region. Concept: textbook diagrams turned into living water. Mood: clinical, bright, lucid; a well-lit physics lab. Palette: white #FFFFFF bench and page, clear cyan #00B4D8 for wave light, deep lab blue #023E8A for troughs, type and apparatus outlines, and signal red #E63946 for sources, measurement cursors and annotations. Light page: the tank itself is pale: crests render as near-white caustic brightness, troughs as blue shade, on a faint aqua base (#EAF8FC). No dark mode. Simulation: discretised 2D wave equation with damping on a grid of 512×320 (384×240 on phones): two-step update u_next = 2u − u_prev + c²·∇²u, with a per-cell wave-speed map c(x,y) (shallow regions slower, for refraction), a barrier mask (u forced to zero, or reflective boundary), and absorbing edges (a damping sponge near the borders so waves do not reflect off the tank walls: the "beach"). Several simulation steps per frame. Sources: point dippers oscillating sinusoidally (frequency adjustable), and a plane-wave bar along one edge. Rendering shader: treat the height field as a water surface lit from above: brightness from the Laplacian/curvature (crests focus light into bright lines, troughs defocus: the real ripple-tank shadowgraph effect), tinted cyan-to-blue, plus a subtle refraction of a faint bench grid beneath the water (offset the grid lookup by the height gradient) so the grid lines wobble with the waves; barriers drawn as solid lab-blue blocks with a soft shadow and a highlight edge; shallow-region inserts as a translucent glass plate shape with a rim; sources as small red dippers with a ring. Layout: the tank is a wide rectangle with a thin drawn frame, corner screws and legs, taking most of the viewport; a slim apparatus rail beside/below it holds draggable components drawn as tidy line icons with labels: "point dipper", "plane-wave bar", "wall", "wall with one slit", "wall with two slits", "curved mirror", "glass plate (shallow)", "prism plate". Experiments as numbered preset tabs across the top, set like headings in a lab manual: "1 Circular waves · 2 Two sources · 3 Single slit · 4 Double slit · 5 Parabolic mirror · 6 Refraction · 7 Free bench". Each preset has a two-sentence note in a side card explaining what to look for, with one measured quantity. Interaction: drag components from the rail into the tank; drag to move them, rotate with a handle, delete by dragging out; slit width and separation adjustable by dragging slit edges; frequency slider (changes wavelength visibly); a "strobe" toggle that freezes the apparent wave motion by sampling in phase (as real ripple tanks do with a stroboscope) so the standing pattern can be studied; click/tap on open water drops a single pulse (a pebble). Measurement tools: a red ruler that reads wavelength when laid across crests, and an intensity probe line: drag it across the pattern and a small plot beside the tank draws the time-averaged amplitude along that line: in the double-slit preset this shows the interference fringes as a row of peaks, with the predicted maxima (where the path difference from the two slits is a whole number of wavelengths; spacing λL/d printed beneath) marked by thin red ticks that line up with the measured peaks. The numbers for the ruler and the probe are taken from a small 320×200 companion simulation run on the CPU in step with the displayed one, so no pixels are ever read back from the graphics card. Selecting a component also opens a small inspector with sliders for its dimensions (slit separation and width, focal length, lengths), and components are keyboard-operable (arrow keys move, [ and ] rotate, Delete removes). Signature moment: the double slit. On load the page opens directly on preset 4: a plane wave marches from the left, meets a wall with two slits, and two fans of circular wavelets emerge and cross, forming the unmistakable alternating beams of bright rippling and calm nodal lines; within three seconds the pattern is established and glittering. Dragging the slits closer or further visibly spreads or tightens the beams in real time. Typography: lab-manual clarity: a geometric/grotesk sans (Helvetica/Arial/"Avenir") in deep blue; title "Ripple Tank" set small-caps tracked at top left with "Apparatus 7 · waves in two dimensions"; numbers and formulae in a monospace or with proper italic variables (λ, d, θ); red hand-drawn-style annotation arrows (SVG) that point out "nodal line" and "central maximum" in the double-slit preset and fade after ten seconds. Buttons are flat outlined rectangles that invert on press; focus rings in red. Fallback without WebGL or float textures: a Canvas 2D CPU simulation at reduced grid size (256×160) with ImageData rendering, same interactions. Performance: adaptive steps per frame; grid capped; pause when hidden; handle resize by re-allocating. Reduced motion: strobe mode on by default, showing a still pattern that updates slowly. DESCRIPTION A bright, clinical lab-manual page built around a living ripple tank. A framed tray of pale aqua water sits on a white bench with corner screws, legs and an apparatus shelf beneath it; numbered experiment tabs run across the top like headings in a practical handbook, and a side column carries the experiment note, one live formula, the frequency control and the probe plot. The page opens on the double slit: a plane wave marches from a red bar, strikes a lab-blue wall, and two fans of wavelets cross into alternating beams of glittering crests and calm nodal lanes, while red hand-drawn arrows name the central maximum and a nodal line and the plot beside the tank grows a row of fringes under thin red prediction ticks. Everything in the tank can be dragged, rotated, resized or thrown out, so each textbook diagram can be bent into another one. VISUAL TECHNIQUES - Real-time 2D wave equation in WebGL: ping-pong float textures, two-step update with a nine-point isotropic Laplacian, per-cell wave speed, barrier mask and an absorbing sponge at the edges - Shadowgraph shading: brightness from surface curvature, so crests focus into near-white caustic lines and troughs fall to cyan and deep blue, with a time-averaged activity tint that leaves nodal lines pale and calm - Bench grid seen through the water, its lookup offset by the height gradient so the lines wobble with the waves - Barriers, mirrors and glass plates painted into a mask canvas and uploaded as a texture; drawn in the shader with soft cast shadows, highlight edges and glass rims - Stroboscope mode using a third texture as a phase-locked snapshot, with no copy pass - SVG overlay in centimetre units for dippers, wave bar, slit marks, rotation handles, ruler and probe, all sized to stay constant on screen - Hand-drawn red annotation arrows that draw themselves with stroke-dash animation and fade after ten seconds - Live SVG intensity plot with predicted maxima computed from path difference, plus peak-spacing and wavelength read-outs measured from a CPU companion simulation - Canvas 2D ImageData fallback engine with the same physics and interactions - Lab-manual typography: tracked small-caps title, oversized outlined experiment numeral, monospace read-outs with italic serif variables, flat outlined buttons that invert when pressed INTERACTION MODEL Choose an experiment from the numbered tabs (or with the arrow keys) to reset the tank to a preset. Drag any component from the shelf into the water, or press it to place one; drag a component to move it, drag its round handle to rotate (Shift snaps to 15 degrees), and drag it out of the tank to return it to the shelf. Red marks on slit walls are draggable edges: inner marks change the separation, outer marks the width, and the beams respond at once. Tap open water to drop a pebble. The frequency slider changes the wavelength visibly; Strobe freezes the pattern by showing the surface once per period; Ruler lays a red rule whose ends can be dragged across crests to read the wavelength; Probe lays a dashed line whose time-averaged amplitude is plotted beside the tank with predicted fringe positions; Still calms the water. A selected component shows sliders for its dimensions, and focused components respond to arrow keys, bracket keys and Delete. With reduced motion requested the strobe starts on, showing a still pattern that refreshes slowly.