Making Physics / Relativity / Kerr Black Hole Ray Tracer
Chapter 19

Kerr Black Hole Ray Tracer

A research-grade GR ray tracer for a spinning Kerr black hole with a relativistic accretion disk — physically correct images, light bending, and spectra.

Interactive · live simulation

Light bending around a Schwarzschild black hole: each ray is a null geodesic. Drag the closest approach inward — rays inside the critical impact parameter b_c = 3√3 M (the shadow edge) plunge in; the rest deflect.

Kerr Black Hole Ray Tracer — simulation render
fig 1. The hero image: an edge-on near-maximal Kerr disk (a=0.998, i=80°). The lensed far side wraps over and under the hole, the photon ring glows, and Doppler beaming brightens the approaching side — the Luminet / Interstellar "Gargantua" morphology.

The same machinery as EHT codes

Everything is in geometrized units G = c = M = 1. The lab implements the Kerr metric in Boyer-Lindquist coordinates and its closed-form inverse, then traces null geodesics via the Hamiltonian H = \tfrac12\,g^{\mu\nu} p_\mu p_\nu with an adaptive Dormand-Prince 5(4) integrator and numerical metric derivatives — the same approach ipole, RAPTOR, and GYOTO are built on, written here in dependency-free C++.

Schwarzschild (a=0) for comparison: a symmetric shadow with no frame-dragging of
fig 2. Schwarzschild (a=0) for comparison: a symmetric shadow with no frame-dragging offset and a clean circular photon ring.

How an image is made

A ZAMO-tetrad pinhole camera launches one photon per pixel inward and traces it backward to the horizon, the disk, or infinity. Disk hits are shaded with the relativistic redshift g = \nu_{\text{obs}}/\nu_{\text{em}}, a Page-Thorne temperature, and the Lorentz-invariant I_\nu/\nu^3 — brightness \propto g^4 T^4, color a Planck spectrum. HDR output plus Python tone mapping handles the enormous dynamic range once.

Gravitational light bending: rays graze, spiral the photon sphere, or plunge, sp
fig 3. Gravitational light bending: rays graze, spiral the photon sphere, or plunge, split by the critical impact parameter 3√3 M.

Validated, not fudged

The console asserts the answers against closed forms: horizon r_+ = 2M and ISCO = 6M at a=0, photon orbit at 3M, Schwarzschild shadow edge at 5.196M = 3√3, ray conservation of energy and angular momentum, the Carter constant to 1e-8. The broad-line red wing reaching g \approx 0.25 at a=0.998 versus g \approx 0.5 at a=0 is exactly the iron-Kα spin measurement used on real AGN like MCG-6-30-15.

The relativistic broad iron line: higher spin pushes the inner disk edge deeper
fig 4. The relativistic broad iron line: higher spin pushes the inner disk edge deeper into the well, stretching the red wing — this is the X-ray spin diagnostic.

This chapter is drawn from the physics-lab study notes and renders. The longer write-ups and project essays live on the blog.

Read more on the blog →