Visualizations
087 / 500

087 · Physics

Chirp

Two black holes spiral together and ring spacetime, from post-Newtonian formulas.

The orbit is integrated with RK4 from the 2PN TaylorT4 equation for x = (M omega)^(2/3), the energy balance between orbital binding and gravitational-wave flux, and pushed into the plunge, where its runaway acceleration makes the final sweep. A short merger then carries the frequency with a continuous slope onto the remnant's ringdown, whose mass, spin, frequency and damping time come from numerical relativity fits. The mesh is the orbital plane: each point shows the quadrupole wave that left the binary earlier (in slowed playback time, so the last cycles stay wide enough to see), cos(2 Phi - 2 phi) falling off as 1/r, so a two-armed spiral tightens into the merger burst and rolls outward. A detector out on the mesh feels the same wave late, its arms stretch and squeeze in the inset, and its strain (scaled to 410 Mpc, about 10^-21) is plotted cycle by cycle. Neutron stars are treated as point masses here, and the remnant is always a black hole.

Try it. Drag the m1 and m2 sliders to pick masses (from neutron stars to 80 solar masses) and watch the chirp mass, frequencies and remnant change. Drag the mesh to orbit the view, P or the arrow keys cycle presets, Space pauses and R restarts. Click for sound: a tone tracks the wave frequency during the slowed playback, then the whole chirp plays back at real speed.

  • Post-Newtonian inspiral (TaylorT4)
  • Quasinormal ringdown fits
  • Retarded-time wave field
  • Perspective wireframe mesh

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 gravitational-wave chirp visualization with JavaScript and the HTML canvas element. 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, stays sharp on high-DPI screens (scale by devicePixelRatio), and resizes with the window. Use a near-black background and draw everything in thin white lines.
- Compute the inspiral of two black holes at leading post-Newtonian order. With chirp mass Mc = (m1 m2)^(3/5) / (m1 + m2)^(1/5), the wave frequency rises as df/dt = (96/5) pi^(8/3) (G Mc / c^3)^(5/3) f^(11/3). Start at 25 Hz for 36 and 29 solar masses, step it with a small time step, and accumulate the phase. Stop at the innermost stable orbit, f = c^3 / (6^(3/2) pi G M).
- Play it back slowed down (say 30 times) and draw the two bodies orbiting at half the wave phase, getting closer as the frequency rises.
- Draw a grid of lines in perspective, like a sheet seen from above at an angle. Displace each point vertically by A cos(2 Phi(t - r/c) - 2 angle) / (1 + r), where Phi is the stored wave phase, so a two-armed spiral of waves flows outward. Keep a history of the phase so you can look up the past.

Once that works, make it beautiful:
- Plot the strain h = A(t) cos(2 Phi) along the bottom, with A growing like f^(2/3), and a playhead.
- Add a ringdown after the merger: a decaying sinusoid at roughly 1.2 / (2 pi G M / c^3) times 0.53, with a damping time of a few milliseconds for these masses.
- Fade line opacity with depth and brighten wave crests so it reads as a 3D surface.

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 adding the 1PN and 2PN corrections, a small L-shaped detector whose arms stretch and squeeze, or playing the chirp as sound.
PreviousLorenz AttractorHundreds of trajectories swirl around the famous butterfly. NextApollonian GasketAn endless packing of kissing circles, each engraved with its exact integer curvature.

Related visualizations

  • RingmakerAstronomy Backlit planetary rings with shepherd moons, wavy gap edges, propellers and waves.
  • Black HoleAstronomy A glowing accretion disk bent into a halo by gravitational lensing.
  • Dark Matter CurveAstronomy Switch off the dark halo and watch a spiral galaxy fly apart.
  • Orbital ResonanceAstronomy A seven-planet resonant chain that chimes on every transit and weaves its own spirograph.
  • Galaxy CollisionAstronomy Two spiral galaxies collide and fling out long tidal tails.
  • InterferometerPhysics A Michelson interferometer: nudge a mirror by nanometers or send a gravitational wave.
  • Stellar VampireAstronomy A star overflows its Roche lobe and feeds a white dwarf's disk until it ignites a nova.
  • Leapfrogging VorticesFluids Smoke rings take turns slipping through each other, from pure vortex dynamics.
  • Planet ForgeAstronomy A dusty disk grows rocky worlds, ice giants and gas giants by N-body accretion.

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

← More from Emergent Mind Labs