Special Relativity Simulator

Documentation

How to use the relativity simulator

The simulator draws a Minkowski spacetime diagram and lets you manipulate its events, observers, and reference frames directly. This document explains how to read the diagram, defines the terms it uses, and works through the twin paradox as a complete example. The physics is special relativity in one spatial dimension, with the speed of light set to one.

The twin paradox

Two twins start on Earth. One stays home. The other boards a fast ship, travels to a distant star, turns around, and returns. When they meet again, the traveler has aged less than the twin who stayed. The prediction is a standard result of special relativity and has been confirmed by atomic clocks flown on aircraft and by the lifetimes of unstable particles in storage rings.

The apparent paradox is the symmetry objection: from the traveler’s point of view, it is the Earth that flies away and comes back. If only relative motion matters, the two perspectives should give the same answer, and each twin should expect the other to be younger. They can’t both be right.

The resolution is geometric and becomes clear once the two histories are drawn on a spacetime diagram. The rest of this document develops the vocabulary needed to read such a diagram — events, worldlines, proper time, the spacetime interval, light cones, reference frames, and simultaneity — and then returns to the twin paradox and resolves it. Open the simulator in a second tab to follow along.

The spacetime diagram

A spacetime diagram puts time on the vertical axis and space on the horizontal axis. One spatial dimension is enough for everything we need: the twins move along a single line, and a Minkowski diagram squashes the rest of space away.

The diagram is not a picture of the scene as anyone would see it with their eyes. It is a chart. Each point on the chart stands for an event — something happening somewhere at some moment. A horizontal slice of the chart shows the universe at one instant in the chosen frame; a vertical line shows the history of one place.

The simulator works in light‑time units. Distances and times are measured in the same unit, so the speed of light is one. A light pulse traces a line at forty-five degrees. Anything moving slower than light traces a steeper line; nothing physical traces a shallower one. A speed of half the speed of light, written 0.5c, climbs one tick upward for every half tick sideways.

Events and worldlines

An event is a point. A worldline is the continuous path an object traces through spacetime: the history of where it was at every moment of its life. The Earth twin’s worldline is a vertical line — same place, time passing. The traveler’s worldline is a tilted line going out, a kink at the turnaround, then a tilted line coming back.

The default scene as the simulator renders it: Earth’s worldline runs straight up the time axis, and the traveler’s worldline goes out to the turnaround and back. Both share the same Start, Departure, Reunion, and End events.

An event in the simulator is a draggable dot. An observer is a list of those dots in order. Connecting an observer’s events gives that observer’s worldline. Two observers can share an event (both twins are at Departure; both are at Reunion) without losing their separate identities. That is the structural fact behind the whole twin paradox: two paths between the same two endpoints.

Proper time

Each twin carries a clock. The time their clock shows when they meet again is their proper time — the time elapsed for them, personally, along their own path through spacetime. There is no universal clock looming over the diagram. There are only worldlines, and clocks that measure them.

The right way to think about proper time is geometric: a clock measures the length of its worldline, in the same way that an odometer measures the length of a road. Two cars driving from one town to another can rack up different mileage if they take different routes. Two twins traveling from Departure to Reunion can rack up different proper times if they take different paths through spacetime.

Turn on proper-time ticks in the simulator and equal-length tick marks appear along each worldline. Count them between Departure and Reunion: the Earth twin has more. That is the twin paradox, stated geometrically.

The spacetime interval

Ordinary Euclidean geometry measures the length of a straight segment with the Pythagorean rule:

length² = (Δx)² + (Δy)²

The corresponding rule in flat spacetime — the spacetime interval — carries a minus sign instead:

(proper time)² = (Δt)² − (Δx)²

That sign change is responsible for most of the counterintuitive results in special relativity. It implies that the worldline that looks longest on the diagram — one that zig-zags out and back — has the shortest proper time, while a vertical worldline that stays at one place has the longest proper time between two timelike-separated events. The straight timelike path between two events is a maximum of proper time, not a minimum of length.

The default scene gives a clean numerical example. From Departure at (0, 0) to Reunion at (0, 10), the Earth twin’s proper time is √(10² − 0²) = 10. The traveler reaches Turnaround at (4, 5); each leg has proper time √(5² − 4²) = 3, so the traveler ages by 6 while the Earth twin ages by 10. The difference comes from the geometry of the two paths, not from any absolute fact about which twin was “really” moving.

Light cones and causal structure

Because nothing physical moves faster than light, only the events inside the forty-five-degree cone above an event — the future light cone — can be reached from it, and only the events inside the cone below it can have caused it. The simulator shades the region outside the cone — the spacelike region — with a faint wash, so the cone itself reads as the unshaded wedge.

Three names are worth knowing. A separation between two events is timelike if a slower-than-light worldline can connect them; a clock traveling between them ticks off positive proper time. It is lightlike (or null) if only a light ray connects them; the proper time along that ray is zero. It is spacelike if no signal can connect them at all. Spacelike-separated events have no agreed order in time — different frames will disagree about which came first — but neither one can affect the other, so the disagreement is harmless.

Reference frames

An inertial reference frame is a coordinate system attached to a non-accelerating observer. Selecting the Earth twin in the simulator makes the grid run vertical and horizontal: vertical is Earth’s time direction, horizontal is a slice of constant time in Earth’s frame. Selecting the traveler during the outbound leg tilts the grid: the time axis tips along the traveler’s worldline, and the space axis tips by the same angle in the opposite direction, so that a light ray continues to bisect the two and to travel at speed one.

The same scene with the traveling twin selected during the outbound leg. The grid tilts into the traveler’s rest frame: their time axis follows their worldline, and their simultaneity line — the dashed line through their current position — tilts the opposite way by the same angle.

The two grids describe the same set of events. Switching observers in the simulator rotates only the coordinate system; it does not move anything in the world. This distinction is worth holding onto: when a measurement — a length, a duration, a velocity — changes as you change frames, what has changed is the coordinate assignment, not the underlying spacetime.

The Lorentz transformation relates the coordinates of an event in two inertial frames moving at relative velocity v:

t′ = γ (t − β x)
x′ = γ (x − β t)

with β = v/c and γ = 1 / √(1 − β²). The inspector applies this transformation automatically, displaying every event’s coordinates in every observer’s frame. The tilt of a moving observer’s grid in the diagram is the same transformation expressed graphically.

The relativity of simultaneity

In Newtonian physics, “at the same time” is a property of the world. In special relativity it is a choice of frame. Two events that one observer calls simultaneous will be separated in time for an observer moving past at any other velocity, and observers in opposite states of motion can disagree about which of the two events came first.

On the diagram, the moving observer’s time axis tilts toward the light line; their simultaneity line — the line of constant time in their frame — tilts the opposite way by the same angle. Enabling the simultaneity layer in the simulator draws a dashed line through the selected observer’s current position. That line marks the set of events that the observer assigns to the present moment in their frame.

Dragging the time slider sweeps the line upward. While the traveler is on the outbound leg, their simultaneity line tilts one way and intersects Earth’s worldline at a slow rate — in the traveler’s frame, Earth’s clock runs slow. On the inbound leg, the line tilts the opposite way and again intersects Earth’s worldline slowly. Each twin observes the other’s clock to run slow during constant-velocity motion, which reproduces the symmetry that motivates the apparent paradox.

Resolution of the paradox

The symmetry breaks at the turnaround. Advancing the time slider through it slowly, and watching where the traveler’s simultaneity line crosses Earth’s worldline, makes the effect explicit: as the traveler switches from the outbound frame to the inbound frame, the crossing point jumps forward along Earth’s worldline by a substantial amount. The traveler’s outbound notion of “Earth, now” refers to an early Earth event; their inbound notion of “Earth, now” refers to a much later one. The Earth events in between are never simultaneous with the turnaround in any single inertial frame the traveler uses.

No physical signal crosses to Earth at the turnaround, and nothing on Earth changes. What changes is the inertial coordinate system the traveler is using to label events. The new system assigns a later Earth-event the label “simultaneous with the turnaround,” and the Earth-years between the old and new labels are simply unaccounted for in the traveler’s frame-by-frame description.

This is the asymmetry the paradox depends on. The Earth twin remains in a single inertial frame for the whole journey; the traveler does not. In flat spacetime, among all timelike worldlines connecting two events, the straight one has the greatest proper time. The Earth twin’s worldline is straight; the traveler’s has a kink at the turnaround; the difference in accumulated proper time follows from that fact alone.

Suggested walkthrough in the simulator

  1. Select the Earth twin. The grid is upright, Earth sits on the time axis, and the traveler’s worldline forms a triangle out and back.
  2. Switch to the traveling twin and advance the time slider through the outbound leg. The grid tilts, Earth’s worldline slants, and Earth’s proper-time ticks accumulate more slowly than the traveler’s.
  3. Move slowly across the turnaround. The traveler’s simultaneity line rotates and the Earth event it intersects jumps forward.
  4. Continue through the inbound leg to the reunion. The proper-time totals in the inspector confirm that the traveler has aged less, by the amount computed from the spacetime interval.

Reference: simulator controls

The simulator opens with the twin paradox scene already built. The left rail holds the controls, the center is the diagram, and the right rail is an inspector that displays whatever is currently selected.

Selected observer
Click an observer in the left rail to make their frame the active one. The diagram’s grid, simultaneity line, and frame-dependent readouts all follow them. The events themselves do not move.
Time slider
Advances along the selected observer’s worldline in their proper time. Press play to animate. When the observer changes velocity, the slider passes through a short transition shaded differently from the inertial legs — that’s where the simultaneity line rotates from one frame to the next.
Layers
Toggle the light-cone shading, current-frame grid, axes, simultaneity lines, event labels, and observer labels. Each observer also has a proper-time tick toggle, and each inertial leg can be turned on as an overlay grid in its own frame.
Selecting and inspecting
Click an event, observer, or path segment to inspect it. Events show their coordinates in every observer’s frame; observers show clock rate, speed, and the per-leg proper time; segments show the spacetime interval and its classification as timelike, lightlike, or spacelike.
Editing
Drag any event to move it. Hold Shift to constrain the drag along an observer’s worldline. The lock button on an event’s location pins its spatial coordinate in a chosen frame, which is how the default scene keeps Earth-side events on Earth’s worldline while you drag the turnaround around. Add or remove stops on an observer’s worldline from the observer inspector.
Undo
Cmd/Ctrl+Z to undo, add Shift to redo. Reset all in the top of the left rail returns to the default twin paradox scene.

The same diagrammatic vocabulary handles the other standard results of special relativity. Length contraction is a difference of simultaneity slices; time dilation is the projection of one worldline onto another’s time axis; the Lorentz transformation is the change of grid. Constructing these scenarios in the simulator is the most direct way to see them.