Worldline Lab: Spacetime Diagram Simulation
Use this free spacetime diagram simulation to turn motion into worldlines, explore light cones and compare observers. Watch why light keeps the same gradient when the reference frame changes.
A spacetime diagram simulation for visual learning
A spacetime diagram records where and when events happen. Worldline Lab connects that diagram to an animated view of ordinary motion. Use it for A-Level Physics extension, special relativity enrichment or introductory university study. Check your own specification for the relativity content required by your course.
Build a worldline from moving objects
The first tab shows a snapshot of space above the diagram. The white observer stays at one position, the cyan observer moves, and yellow light pulses travel in opposite directions. As time advances, the horizontal time slice moves upwards. Each object leaves a history called its worldline.
Pause and scrub the time slider to connect one snapshot with one row of the graph. Change the cyan observer’s velocity to compare a stationary worldline with a moving one. A constant velocity gives a straight worldline. Moving to the left gives the line a negative gradient, while a stationary observer’s worldline is vertical.
Why does light have a constant gradient?
Position x is horizontal and ct is vertical. Multiplying time by the speed of light gives both axes the units of distance. Here both use light-seconds: one light-second is the distance that light travels in one second. Equal scales on the axes make light’s worldlines appear at 45°.
The gradient is Δ(ct)/Δx = c/v. Therefore, light moving right has gradient +1, while light moving left has gradient −1. A slower object has a steeper worldline. This is the reverse of the familiar position-time graph, where time is horizontal and the gradient gives velocity. The 45° angle follows from the plotting convention; it is not a physical direction in space.
Turn on the gradient triangle and compare the distances across and up. They are equal for a light pulse. You can also show ticks of the moving observer’s clock. Those marks represent equal intervals of proper time, which is the time recorded by the observer’s own clock.
Explore events and the light cone
In the second tab, event A stays at the origin. Drag event B or adjust its position and time with the sliders. An event needs both coordinates. A flash at one place and time is an event; receiving the flash elsewhere is another event.
The yellow light paths form the boundary of A’s light cone. Inside the future cone are events that A could influence using light or a slower signal. Inside the past cone are events that could have influenced A. Outside both cones, neither event can influence the other without exceeding light speed.
The lab classifies the separation as timelike, lightlike or spacelike. The displayed interval is Δs² = (cΔt)² − (Δx)². It is positive for timelike separation, zero for lightlike separation and negative for spacelike separation. Coincident events are identified separately. In one spatial dimension the cone appears as an X; additional spatial dimensions give the familiar cone shape.
Change observer in the spacetime diagram simulation
The third tab redraws the same events in another inertial reference frame. Select Moving frame and watch space and time coordinates change together. The cyan observer’s worldline becomes vertical because that observer is now at rest in the displayed frame. The white lab observer moves the other way.
Light keeps its ±45° paths throughout the transition. The coordinate table shows why the event has not changed: its coordinates differ, but the spacetime interval remains the same. Dashed lines through B compare which events each observer considers simultaneous with B.
The lab uses the Lorentz transformation, x′ = γ(x − βct) and ct′ = γ(ct − βx), where β = v/c and γ = 1/√(1 − β²). The smooth transition passes through intermediate inertial frames. It does not depict the history of an accelerating observer, and it does not represent what a camera would photograph.
Try these short investigations
First, set the observer’s velocity to zero and explain the vertical worldline. Next, increase it to 0.90c and compare its gradient with light’s. Then move B across the light-cone boundary. Finally, choose B at x = 4 light-seconds and t = 2 seconds, and change observer at 0.60c. Compare the coordinates and verify that the interval stays −12 square light-seconds.
Continue your physics revision
Connect these flat-spacetime diagrams with Spacetime Explorer: gravity and black holes, browse all free physics simulations, or practise with A-Level Physics questions by topic. For further explanations, see the Max Planck Institute’s introduction to spacetime, the University of North Carolina’s spacetime diagram notes and Weber State’s Relativity in Five Lessons. If this spacetime diagram simulation helps, share it with a student, classmate or colleague.