Spacetime Laboratory
On this page
Quick Answer
There is one Einstein equation, but it has many solutions — each solution is a different universe. This interactive page lets you fly a camera through nine of those universes in your browser, bend light around black holes, expand a cosmos, and stretch a ring of test particles with a passing gravitational wave.
Key Terms
- Einstein field equation
- Metric tensor
- Schwarzschild metric
- Kerr metric
- FLRW cosmology
- Cosmological constant
- Gravitational waves
- Gravitational lensing
- Null geodesic
- Geometrized units
Frequently asked questions
Does the shader solve Einstein’s field equation in real time?
No. The page numerically integrates Schwarzschild and subextremal or extremal Reissner–Nordström light rays, integrates a homogeneous FLRW expansion history, and uses teaching approximations for the other scenes. It does not solve the field equation for arbitrary matter.
Are the visual effects physically accurate?
Accuracy varies by mode. Spherical black-hole rays use null-geodesic equations with finite numerical error; Kerr rays and all disk colours are illustrative. FLRW uses the mixed-density Friedmann equations, while its sky is a diagram. The wave ring uses linear strain geometry with a labelled display magnification. None of these scenes is an observatory-grade image.
Why does the laboratory use geometrized units?
Setting G = c = 1 removes enormous and tiny powers of ten from the arithmetic, which keeps the GPU’s floating-point numbers in a comfortable range. Lengths and times are then both measured in units of the black hole’s mass.
What is the difference between the event horizon and the black-hole shadow?
For a Schwarzschild hole, the horizon is at r_s = 2GM/c². For a very distant static observer, the shadow’s critical impact parameter is 3√3 GM/c², about 2.6 r_s; its diameter is about 5.2 r_s. The apparent angular size also depends on the observer.
Checking article narration…

There is a quiet moment in every physics education when the furniture of common sense is pushed against the wall. For me it was the realization that the question “where did that photon go?” does not have an answer written anywhere in space. Space, it turns out, is not the stage. It is one of the actors.
This page is a small interactive museum built around that reversal. One equation hangs on the wall; behind nine doors are nine solutions and limits it permits. The interactive view needs a browser with working WebGL2 support; the equations, graphs and explanatory panels remain available when that graphics context cannot be created.
Interactive · General relativity
Spacetime Laboratory
The universe is not drawn on graph paper
School physics begins on graph paper. Distances are measured with rulers that do not stretch, times with clocks that do not drift, and light travels obediently along the grid lines. This is not a bad approximation — it is spectacularly good for throwing a cricket ball or landing a probe on the Moon, given a little help. But it is an approximation.
General relativity replaces the fixed stage with a dynamic one. The central claim is not that gravity is a force pulling objects through space. It is that matter and energy alter the geometry of spacetime itself, and free objects — planets, photons, you, falling — follow the straightest available paths within that curved geometry. What we call the “force” of gravity is the geometry asserting itself.
The practical consequence is startling: to know what the universe looks like, you must first specify its geometry. Change the geometry and the same star field, the same galaxy, the same ring of dust will look different — bent, reddened, multiplied, dragged sideways, stretched apart.
One equation, many possible spacetimes
It is important to be precise here, because popular writing often speaks of “Einstein’s equations” as though there were a shelf of unrelated formulas, one for black holes, one for cosmology, one for gravitational waves. There is one central equation — the Einstein field equation:
That compact line is worth unpacking piece by piece, because every universe in the laboratory is hidden inside it:
- is the metric tensor — the machinery for measuring intervals. Given two nearby events, the metric tells you their separation in space and time. Everything else is built from it.
- is the Einstein tensor, a particular combination of the metric’s curvature, assembled so that it automatically respects the conservation of energy and momentum.
- is the stress–energy tensor — the complete inventory of matter, energy, momentum, pressure, and stress at each point.
- is the cosmological constant, the energy density of empty space itself. Einstein called it his greatest blunder; the accelerating universe put it back on the payroll.
- is the coupling constant, the exchange rate between geometry and contents. Its smallness is why spacetime is so stiff — why you need a star’s worth of mass to bend it noticeably.
John Archibald Wheeler’s famous summary is the right way to hold it:
Matter and energy tell spacetime how to curve; curved spacetime tells matter and light how to move.
Useful — but incomplete. The equation is nonlinear: gravity itself gravitates, and “the energy stored in the gravitational field” cannot be localized into a tidy entry in . The geometry on the left and the matter on the right must be solved together, self-consistently. That is why the equation is ten coupled nonlinear partial differential equations wearing a trench coat, and why exact solutions are treasures.
The different “universes” in this laboratory are not different equations. They are different solutions and limits of this one equation, obtained by choosing different distributions of mass, angular momentum, charge, pressure, and — and then asking what the geometry does to light.
How a shader can bend a ray of light
A fragment shader is a small program that the GPU runs once per pixel. The laboratory’s black-hole views do the following, within the numerical budget selected by the quality control:
- Build a camera ray from the observer through this pixel.
- Sample a deterministic procedural sky — stars with varied temperature and brightness, a Milky-Way band, sparse galaxies — seeded so that split-screen comparisons always see the same universe.
- For Schwarzschild and Reissner–Nordström, integrate the spherical null-geodesic equations using fourth-order Runge–Kutta steps. For Kerr and weak gravity, use a labelled bending approximation instead.
- Decide the ray’s fate: it escapes to the sky, crosses the accretion disk and collects its light, or passes the event horizon — in which case it never returns, and the pixel is dark.
- Colour the disk and sky with illustrative shift and brightness effects, then apply tone mapping. These colours are not a radiative-transfer calculation.
The shader does not solve the Einstein field equation. Its spherical black-hole ray equations follow from the known metrics, but their numerical trajectories have finite error. Near the shadow edge a ray can loop repeatedly and exhaust the step budget; faint higher-order images need particular caution. Kerr’s spin-dependent swirl is an illustration, with no claim to the exact Kerr silhouette. The cosmology and wave sky patterns are diagrams, rather than integrations of light through their full metrics.
Flat spacetime: the control experiment
Every experiment needs a control, and ours is the Minkowski metric:
Select Flat spacetime in the laboratory. Light rays travel in straight lines. The coordinate grid is regular. Stars sit exactly where the seed put them. Clocks at different positions tick at the same rate — the “What am I seeing?” panel will report a time dilation of exactly 1.
This is the universe of special relativity: no matter, no curvature, no surprises. Keep this picture in your head, because everything else on this page is a deviation from it.
Weak gravity and the Newtonian limit
General relativity did not abolish Newton; it absorbed him. When gravity is weak and speeds are slow, the Einstein field equation reduces to Newton’s law, and the metric is only slightly dented:
The Newtonian weak-field mode illustrates this regime with a bending approximation. The compactness and magnification sliders set its strength. The graph shows the inverse-impact-parameter trend; it is a reference curve, not a measurement extracted from the displayed pixels. At zero compactness the bending vanishes. Large compactness or magnification takes this illustration outside the weak-field approximation.
Newtonian gravity is not a competitor theory on a shelf here. It is the low-speed, weak-curvature limit of general relativity — which is precisely why the exaggeration slider exists. Real planetary lensing is arcseconds; the educational magnification is always labelled.
Schwarzschild: the quiet black hole
In 1916, months after Einstein published his theory, Karl Schwarzschild found the first exact solution from the trenches of the Eastern Front: the geometry outside any spherically symmetric, non-rotating mass. In Schwarzschild coordinates:
Everything about a non-rotating black hole is in that line. The structure falls out of the radius at which the terms misbehave:
- The Schwarzschild radius . For the Sun, about 3 kilometres; for the black hole at our galaxy’s centre, about 12 million. Here the time coefficient tends to zero and the radial coefficient diverges. This is a coordinate singularity, rather than a divergence of spacetime curvature. The Kretschmann scalar, , is finite at and diverges only at .
- The event horizon sits at . It is not a material surface. Nothing blocks you there; no wall, no membrane, no sign. It is a one-way causal boundary: light emitted inside it never reaches the outside universe. The shader honours this honestly — rays crossing the horizon are terminated not because they hit something, but because they cannot come back.
- The photon sphere at : the radius where light itself can (unstably) orbit. Photons arriving near this radius loop the hole one or more times before escaping — this is what produces the higher-order “ghost” images of the disk.
- The ISCO at : the innermost stable circular geodesic for massive particles in Schwarzschild spacetime. The default disk starts there, but its edge is an editable illustration rather than a simulated accretion flow.
- The shadow: for a very distant static observer, the critical impact parameter is . That is a radius in the observer’s image plane; the corresponding shadow diameter is about . Close observers require an angular calculation.
Turn on the horizon, photon-sphere, and ISCO guides and slide the observer inward. These circles mark reference radii schematically; they are not lensed images of material surfaces. The annular disk is sampled where traced rays cross its plane, so far-side light can appear above and below the shadow.
The clock panel reports for a static observer held at the chosen radius, relative to Schwarzschild time at infinity. This ratio tends to zero near the horizon. It is not the clock formula for an orbiting or falling camera. A freely falling traveller crosses a sufficiently large hole’s horizon in finite proper time; the static-observer formula does not describe that journey.
Kerr: when spacetime itself is dragged around
Real black holes spin, and spin changes the geometry qualitatively. The Kerr solution (1963) describes a rotating black hole. Its full metric is long enough that it lives in the collapsible section below; its structure is defined by two functions:
where is the angular momentum per unit mass, in geometrized units. The horizons solve : (with ). They exist only when — the extremal limit — which is why the spin slider stops at 0.998 and will not quietly let you build a naked singularity.
Rotation introduces an effect with no Newtonian analogue: frame dragging. Between the outer horizon and the stationary-limit surface, , a worldline cannot stay at fixed Boyer–Lindquist spatial coordinates. The outer surface meets the equator at . In the exact Kerr solution:
- the shadow is offset and deformed, flattened on the prograde side;
- prograde photons swing closer to the hole than retrograde ones;
- the disk’s approaching side is boosted brighter and bluer by relativistic beaming; the receding side dims and reddens;
- stable prograde orbits exist closer to the horizon than any orbit in Schwarzschild.
The laboratory’s Kerr view illustrates this handedness with a spin-dependent swirl. Its analytic horizon and prograde equatorial ISCO readouts are quantitative; its shadow deformation and disk appearance are not. At zero spin it uses the spherical Schwarzschild ray calculation. An equatorial reference circle cannot depict the full angle-dependent ergosphere.
The full Kerr metric, for the patient
In Boyer–Lindquist coordinates, with and as defined above and :
The mixed term is frame dragging made algebraically explicit: the geometry couples time and rotation. Setting returns the Schwarzschild line element. This displayed equation explains the physics; the spinning scene does not numerically integrate the full equation.
Charged black holes and mathematical edge cases
The Reissner–Nordström solution adds electric charge to the Schwarzschild geometry:
Charge contributes a repulsive term — the electromagnetic field’s energy fights the attraction. The horizons now solve , giving two of them, in geometrized units: an outer event horizon and an inner (Cauchy) horizon. As they merge into one extremal horizon.
Push the charge slider past 1 and the panel reports that there are no horizons. The renderer stops the black-hole calculation in this naked-singularity regime; it does not silently clamp the charge to an extremal hole or simulate the singular interior.
A candid caveat: astrophysical black holes are expected to carry negligible sustained net charge — a charged hole in a plasma universe neutralizes quickly. This mode is a window into the mathematical family of solutions, not a portrait of anything likely overhead.
FLRW: the geometry of an expanding universe
Zoom out from one black hole to the whole cosmos. Assuming the universe is homogeneous and isotropic on large scales, the field equation admits the Friedmann–Lemaître–Robertson–Walker metric:
The scale factor describes the homogeneous expansion; labels open, flat, and closed spatial curvature. The background obeys
The laboratory integrates this mixed-density background from a reference epoch with . Its graph, grid scale and redshift readout use the same history. The animated sky remains a schematic picture; it does not place sources on a computed past light cone. The colour shift compares emission at that reference epoch with observation at the current epoch, using . It is not inferred from each drawn galaxy’s distance. The equations and density closure follow the Friedmann background in David Tong’s cosmology notes.
Two things this mode is careful not to say. First, expansion is not galaxies flying outward through a static box — that is why the grid expands with the metric rather than the dots drifting across a fixed frame. Second, expansion does not stretch bound systems. Atoms, people, planets, and galaxies are held together by forces far stronger than the local Hubble drag; they do not swell with the universe. Only the distances between gravitationally unbound structures grow.
Radiation, matter, curvature and dark energy all contribute to the integration. The familiar single-fluid power laws are analytical checks, rather than a substitute for the mixed history. The normalized time axis is from the reference epoch. Each simulation second advances times the expansion-speed setting; the chosen determines the dimensionless evolution. Selecting open, flat or closed rescales the density mix to totals 0.75, 1 or 1.25 respectively. Subsequent density edits set the curvature through the closure relation. The comoving/proper grid toggle changes the drawing convention, not the calculated history. A contracting solution is followed to the displayed small-scale cutoff; very large scale factors and very late times also have explicit display limits.
The cosmological constant
Set and keep only :
Empty space still has geometry, and decides its character. With you get de Sitter space: its flat slicing has exponential expansion, , and a comoving observer’s cosmological event horizon has proper radius . The marker here is a schematic shrinking circle, rather than a calibrated angular image. In general cosmology, recession faster than light does not by itself imply permanent causal disconnection.
With you get anti-de Sitter space, with curvature scale and a timelike conformal boundary. Its global causal structure and boundary conditions differ from de Sitter’s; replacing by a negative number in an exponential is not an AdS model. The view here uses a patterned distortion as a teaching metaphor. Its graph shows the analytic static-coordinate clock factor , not an expansion history. AdS is central to the holographic correspondence, AdS/CFT.
These two screen views do not integrate their global null geodesics. Use the equations and graph for the stated analytical relations, and the sky patterns as illustrations.
Gravitational waves: geometry in motion
Linearize the field equation around flat space — with — and the vacuum equation becomes a wave equation. The solutions are gravitational waves: propagating perturbations of the metric itself, travelling at , with two polarizations, plus and cross. They are not waves moving through a medium; the geometry is the thing waving.
A ring of test particles makes the effect visible. At linear order, a plus-polarized wave gives fractional changes and along perpendicular axes. Cross polarization rotates these axes by 45°. Detector orientation matters: the fixed horizontal and vertical arms drawn here respond to plus polarization, while a pure cross wave has zero first-order length response in those particular arms.
Astrophysical waves reaching Earth can have strain of order . Physical scale now applies that small input without magnification, producing no visible deformation. The exaggerated mode multiplies it by the displayed factor, with peak display strain capped at 0.5 to keep the diagram legible. At that magnification the picture exceeds the small-strain regime, so it is not a quantitative strong-wave solution. The repeating chirp sweeps an invented frequency and envelope; it is not a fitted binary-merger waveform.
What the visualization calculates
- Spherical null rays. Schwarzschild and charged black-hole modes use the spherical static metric’s null-geodesic equations, initialized in a static observer’s orthonormal frame, with finite Runge–Kutta steps.
- Analytical readouts. Horizon radii, circular photon orbits, applicable ISCO radii and static-clock factors depend on the selected model. Kerr has no single spherical photon-orbit radius.
- A mixed FLRW background. Matter, radiation, curvature and vacuum energy determine one expansion history, shared by the graph and diagram. This is a homogeneous background calculation, not a cosmological sky survey.
- A linear wave diagram. The test ring uses tensor strain with the displacement and a 45° rotation between plus and cross.
- Deterministic sky. One seeded star field serves every mode, so comparisons are controlled experiments.
Black-hole scene lengths use geometrized units with : one scene unit is , and the Schwarzschild horizon is at 2 units. The physical conversion is per solar mass. Changing solar mass changes this physical scale; with camera and disk radii held in , it does not enlarge the normalized image. Cosmology and wave scenes use their separately labelled presentation units. The metric signature is .
What the visualization deliberately simplifies
This section is part of the exhibit, not fine print.
- It does not solve the Einstein field equation from arbitrary matter distributions.
- It does not simulate black-hole formation, full numerical relativity, or magnetohydrodynamic accretion.
- The spinning Kerr view is a bending and swirl approximation. Its silhouette is not a verified Kerr shadow.
- The disk is a thin annulus with an illustrative velocity and colour model. Brightness, redshift colours and beaming are not a calibrated radiative-transfer calculation.
- Gravitational-wave strain and weak-field lensing are magnified by labelled exaggeration factors.
- FLRW, de Sitter and anti-de Sitter sky patterns are schematic. Only the explicitly stated background and analytical relations are quantitative.
- The embedding-diagram language elsewhere in physics (rubber sheets, funnels) is a teaching analogy for a spatial slice. Spacetime does not bend into anything; there is no external dimension receiving the dip.
Experiments to try
- Compare spherical shadows. Keep the same camera and sky, then compare Schwarzschild with charged Reissner–Nordström at zero charge. They should agree. Increase charge below the extremal limit and compare the analytical radii.
- Separate numbers from illustrations. Change Kerr spin and watch its horizon and prograde ISCO readouts. Treat the accompanying swirl as an illustration, rather than a precision test of Kerr lensing.
- Check a static clock. At in Schwarzschild mode the ratio should be . Move toward the minimum allowed radius, , and watch it decrease.
- Change the cosmic contents. In FLRW mode adjust matter and dark energy, then compare the resulting mixed-density graph. Toggle comoving/proper grid drawings without changing the calculated scale factor.
- Compare polarizations and detector orientation. Switch plus to cross with the ring enabled: the principal axes rotate 45°. The fixed screen-axis detector arms have a different response.
- Remove magnification. Choose physical wave strain and observe the ring become visually circular. Return to the amplified mode and read its actual display factor and cap.
- Test the controls. Zero weak-field compactness, RN charge, Kerr spin or wave amplitude separately. Compactness removes weak bending, zero charge gives Schwarzschild, zero spin selects spherical rays, and zero amplitude removes the wave deformation. These are different physical limits.
Where the equations stop being comfortable
The laboratory ends where honesty requires it. Inside the Schwarzschild radius, the roles of the and coordinates exchange; the singularity at is not a place but a moment that cannot be avoided. The Kerr interior contains a Cauchy horizon beyond which predictability fails. Extremal and super-extremal regimes brush against the cosmic-censorship conjecture, unproven after half a century. The FLRW metric extrapolated backward meets the Big Bang singularity, where the classical equation simply stops being the right theory. And the cosmological constant — measured, nonzero, and tiny in units where it has no business being tiny — is either the deepest clue in physics or the most expensive red herring ever purchased.
One equation. Many universes. The sliders are yours; the geometry does not negotiate.
What this laboratory does—and does not calculate
It does: numerically integrate spherical black-hole light rays and a homogeneous FLRW background; report selected analytical radii and clock factors; and draw labelled illustrations for rotating holes, waves and cosmological skies.
It does not: solve arbitrary Einstein equations; simulate black-hole formation or full numerical relativity; model realistic accretion flows; produce observatory-grade images; display four-dimensional spacetime; or claim that a rubber-sheet picture is physically literal.
Technical note: numerical methods and performance
- Spherical ray integration. Fourth-order Runge–Kutta uses radius-scaled finite steps and a quality-dependent step budget, with escape and capture checks. The static spherical shadow boundary is classified from the analytical photon potential. Finite trajectories, disk crossings and higher-order images still depend on numerical resolution. The highest quality setting is a larger rendering budget, not a research certification.
- Kerr. A spin-dependent swirl supplies an illustrative asymmetry. The full Kerr geodesic equations are not integrated.
- FLRW. Fourth-order Runge–Kutta integrates the acceleration equation from , including recollapse when the selected background turns around. Analytical single-fluid and flat matter-plus-vacuum limits, the Friedmann constraint and time controls are tested independently.
- Determinism. The sky is hashed from a single integer seed; split-screen and shared URLs reproduce the identical universe.
- Runtime limits. A hard iteration cap bounds GPU work. Initialization, shader compilation and context-loss failures have distinct error handling. WebGL resources are released on navigation. Frame rate depends on the GPU, browser, viewport and quality setting; there is no guaranteed 60 fps.
- Accessibility and fallback. Reduced motion pauses animation; controls and explanations remain available if WebGL2 cannot initialize. A poster is an illustration, not evidence that the live renderer is running.
| Parameter | Physical meaning | Visible effect |
|---|---|---|
| Mass | Central gravitating mass | Changes physical distance scale; normalized image stays fixed at equal radii in |
| Compactness | Weak-field strength | Illustrative deflection |
| Spin | Kerr rotation rate | Analytical horizon and prograde ISCO; illustrative swirl |
| Charge | Normalized electric charge | Charged spherical rays, model-specific radii and extremal warning |
| , , | FLRW expansion history | Integrated background, schematic grid and reference-epoch redshift |
| Vacuum energy | Analytical reference graph with a schematic sky | |
| Strain | GW metric perturbation | Breathing ring, alternating arm lengths |
| Observer , | Camera position | Dilation readout, shadow angular size |
| Integration steps | Numerical budget | Accuracy of bending vs. frame rate |
Word Cloud
Related reading
Selected by shared topics and section, with closer publication dates breaking ties.


