loading...
running...
How to use
Two views. Orbits & rays: parallel light rays from the left (red = captured, blue to orange = bent), the white extra ray at the impact parameter you choose, and a probe whose orbit you set with p and e. Lensed sky: the star field as seen by an observer at the chosen distance; drag to turn it. Things to try: (1) set the extra ray to 5.2 and then 5.1 M, the first wraps around, the second falls in; (2) the Precessing rosette preset, then switch the Newtonian ellipse off; (3) Plunge: lower p until 6 + 2e is above it; (4) Sky: close, then move the observer out and watch the Einstein ring shrink as sqrt(1/D). Space pauses, R resets the orbit.
Probe sprite and star map were rendered in Blender; the maths runs in plain JavaScript Canvas.
The science
Units. Lengths are in M = GM/c² and times in GM/c³ (so the horizon is at 2 M, the photon sphere at 3 M and the ISCO at 6 M). The readouts convert to kilometres and seconds for the object you choose (1 M = 1.48 km per solar mass).
Light. In the equatorial plane a light ray with impact parameter b obeys d²u/dφ² = -u + 3 u², u = 1/r integrated here with RK4. Far from the hole the deflection is 4/b + 15π/(4b²) (the first term is Einstein's 1915 result, twice the Newtonian value); as b falls to bc = 3√3 M = 5.196 M the ray winds more and more around the photon sphere and then is captured. The dashed blue circle of radius bc is the shadow seen from far away.
Orbits. A massive probe has conserved energy E and angular momentum L: (dr/dτ)² = E² - (1 - 2/r)(1 + L²/r²) For the orbit with semi-latus rectum p and eccentricity e, L² = p²/(p - 3 - e²), E² = [(p-2)² - 4e²]/[p (p - 3 - e²)] and the orbit is bound and stable for p > 6 + 2e. Unlike Newtonian gravity the ellipse does not close: the periapsis advances by about 6π/p radians per lap (exactly 4 √(p/(p-6+2e)) K(k) - 2π with an elliptic integral K). That is Mercury's 43 arcseconds per century, here a hundred thousand times faster. The grey dashed ellipse is the closed Newtonian orbit for comparison.
The sky view. A static observer at radius r sees a ray arrive under angle α to the direction of the hole, with impact parameter b = r sin α / √(1 - 2M/r). Following that ray backwards to infinity gives the direction β of the star it came from (β = α in flat space). The picture is the star map looked up at β(α) for every pixel, a CPU ray-trace of 150,000 rays. Rays with α below the shadow angle sin αs = (bc/r) √(1 - 2M/r) fall in and are black; where β = 0 a source straight behind the hole forms the Einstein ring, for a distant observer at D of radius θE = √(2Rs/D).
Spin. The a* slider only draws the prograde Kerr ISCO from Bardeen-Press-Teukolsky, r = 3 + Z2 - √((3 - Z1)(3 + Z1 + 2 Z2)) and does not alter the rays or orbits, which stay Schwarzschild. Simplifications: equatorial plane only, test particle (no gravitational waves or back-reaction), no accretion matter, static observer.