Lorentz Transformation Animations

Relativity tells us that if moving very fast, clocks slow down, rulers shrink, and everything gets more massive. And no signals can travel faster than light. But what do these strange statements really mean? This page will try to explain, using animations to illustrate the counter-intuitive behaviour of space and time that physicists call a Lorentz transformation, and which is at the heart of relativity.


You should see a button to the left saying Show Lorentz window.   (If not, see here.)   To download, see below.

Once the Lorentz window is up, you can choose an example from the pulldown menu to view an animation, or set up your own. Details are explained below, but the basic idea is that in the two animation panels we see the same thing from two frames of reference.


Each animation illustrates a thought-experiment. The ingredients are simple: red and blue dots represent objects, while green expanding circles represent light flashes. The animation panels themselves show two frames of reference moving with respect to each other at constant speed. Typically, the red dots are at rest in the left panel while blue dots are at rest in the right panel.

If you are familiar with spacetime diagrams, think of taking a three-dimensional spacetime diagram and replacing the time axis with `animation time'.

  1. User defined.   To set up your own animation, first clear the GUI. Then put down some red and blue dots by pressing the appropriate button, and clicking on the panels with the mouse. Each time you click on the black area with the red or blue button pressed, two new dots appear, one where your mouse is, and one in the other panel. This process sets the scene at the midpoint of the animation. To set the relative velocity of the reference frames (as a percentage of the speed of light) use the vel input field. To start the animation press run;; remain fixed in the left frame but move in the right frame, contrariwise for blue dots. While the animation is running, you can initiate light flashes by clicking with the mouse.

    You can pause the animation, step forwards or backwards, or run again, or clear for a fresh start.

  2. Speed of Light.   Here we imagine the blue dot emitting light, while moving in the left frame but at rest in the right frame. And clearly, in the left frame the light will be redshifted at the left and blueshifted at the right.

  3. Time dilation.   This example is a schematic version of the Michelson-Morley experiment and a scenario often used to derive the Lorentz transformations. The animation looks a bit complicated, but if you follow it through you can see exactly why the constancy of the speed of light requires length contraction and time dilation.

    The lower left blue dot emits a light flash just as it passes the first red dot. The light flash is reflected by the two blue dots above and to the right, and returns from both just as the original blue dot crosses the second red dot. Consider the light that went to the upper mirror and returned after reflection. In the left frame it has travelled a longer distance than in the right frame. If light has constant speed, time must be running slower in the left frame. Now consider the light that went to the right. It must catch up with the right mirror, get reflected, and then come back to the original blue dot just as the the other reflected light comes back. To make this all work in both frames, the right mirror has to move a bit closer, otherwise it takes light too long to catch up with it. Hence we have length contraction.

  4. Length contraction I.   Here we see that the red and blue rows can align if the longer one is moving. At the moment of alignment in the left frame, two lights flash. In the right frame, there can be no alignment. The two lights still flash, one as the front tips align and one as the back tips align, but these flashes are not simultaneous.

    This little demonstration has many incarnations and is probably the most common of thought-experiments in relativity. Sometimes it appears as a parable about trains, often it is called the barn and pole paradox. The key point is that true simultaneity requires being in the same place as well as the same time (such as a light flash and two dots all coinciding). If the events are in different places, they can be simultaneous is one frame but not another.

  5. Length contraction II.   A lesser-known thought experiment involves length contraction of an object that is not aligned with the direction of motion. Length contraction happens only in the direction of motion, not the transverse direction. The result is a tilt. Here we see that the blue row can pass through a gap that is too short, either by contracting in length, or by tilting, depending on the frame.

  6. Velocity addition.   In this scenario, in the left frame, the red formation is moving at 80% of the speed of light. So if the relative velocity between the frames is more than 80% it would appear from the left frame that the relative velocity between the red and blue dots is more than the speed of light. And comparing with the expanding circle, this does appear to be the case.

    But if we change to the right frame where the blue dot is still, and then measure the speed of the blue dots (which is the correct way to measure relative velocity) we find the red formation never catches up with the light flash, and hence must be moving slower than light. Lenght contraction and time dilation have reduced the seemingly superluminal speed to subluminal.

  7. Relativistic momentum.   In this thought-experiment, the red team and the blue team sail past each other and as they do they punch each other. In the left frame, blue appears to be punching more slowly, despite its transverse speed. (This becomes obvious if you increase the relative velocity between the frames to 0.99 so so.) The reason is, of course, time dilation. Meanwhile, in the right frame, red appears to be punching more slowly. So both teams would expect to punch the other team back. But that cannot happen; since the thought-experiment is symmetric in red and blue, the outcome of the punchup must be a draw. But how can the other team gain a draw (that is, punch with the same momentum) while punching more slowly? Only by increasing in mass. Thus we infer that moving bodies become more massive.

  8. and 9.   Fountain vs Sound.   Finally, two examples show what light does not do. Sometimes our intuition may liken light to water flowing out of an omni-directional fountain. And often we think of light as a kind of very fast-moving sound. Fountains and sound both have something analogous to redshift, but light behaves differently from both.

    In the case of the fountain, the speed of water depends on the speed of the fountain. But the speed of light is independent of the speed of the source. As for sound, it moves with constant speed with respect to the medium. Thus in the sound animation, you have to imagine a wind blowing to the left in the right panel, dragging the centres of the circles along with it, whereas in the left panel there is no wind and the centre of each circle stays fixed. In contrast, light has no medium. Light behaves like some strange hybrid of fountain and sound, something utterly contrary to our everyday experience and our intuition. Think of it as magic, if you like.

The Program

You can run the program from a command line with
java -jar Lorentz.jar
This also lets you save output to disk.

A earlier version is described in a paper in Amer J Phys, 71, 1276-1279 (2003).

The Equations

The basic equations are of course the Lorentz transformations to go from an event xR,tR in the right frame to the same event xL,tL in the left frame.

xL = γ (xR + vtR)
tL = γ (tR + vxR)

The origin of a light flash is conveniently transformed in this way. But for the red and blue dots we need to rewrite the transformation somewhat, because we need to transform not a single event but a trajectory xR(tR) in the right frame to the corresponding trajectory xL(tL) in the left frame. In order to do this, we reconsider the second equation above, as

tL = γ (tR + vxR(tR))

and then solve for tR(tL). This is trivial if xR(tR) is a constant, and easy if it is a straight line. Having tR(tL) in hand, we consider the inverse Lorentz transformation

xR(tR(tL)) = γ (xL(tL) - vtL)

and now from this we can easily extract xL(tL).

Books and web pages

Over the last hundred years many people, including at least two great physicists, have tried explaining relativity in a way that doesn't require studying university physics. So there is an abundance of books and web pages. Here are just a few I found distinctive, of which the first and last especially inspired this page.

Gamow's Mr Tompkins books were hugely popular when they first appeared and continue to be widely read. I read them half-comprehendingly as a child, and continue to return to them and marvel at their subtlety. In comparison, Landau and Rumer's What is Relativity? feels mediocre, as if Landau had never really engaged his brain on it. But the cartoon illustrations are wonderful.

It's About Time by David Mermin is a serious introduction to special relativity without using calculus. I am not completely convinced that the algebra + arithmetic route that Mermin takes is clearer than a more geometric route would have been. But that aside, the text, like anything Mermin writes, is very insightful.

Andrew Hamilton's special relativity pages have lots of interesting animations, some similar to the ones here.

Beautiful computer graphics is to be found in Seeing Relativity by Antony Searle, and in Spacetime Travel and Tempolimit Lichtgeschwindigkeit by Ute Kraus and colleagues. These sites concentrate on flight simulators (that is, the view of a single observer, or Terrell rotation).

In the eye-candy category, I particularly recommend the EinSteinchen miniature videos from Deutsche Welle, which are fun to watch even though any scientific content has been diluted to nothing.

But the best of all, the leader of the pack, the justly described gold nugget, is the strangely little-known Relativity Visualized by Lewis Carroll Epstein. This amazing book explains most of special relativity and a fair bit of general relativity with almost no equations. The whimsical ink drawings that best any computer graphics, and the irreverant prose that makes Feynman Lectures sound dull, all help make it memorable, but the book's real genius is that it gets the reader to think through complicated scientific reasoning, and indeed make you ask what after all a physics theory is. Part of the fun is that Epstein gives the impression he is dumbing down, even as in fact he is doing the very opposite. Unfortunately the book is out of print at the moment, but hopefully only until a new edition appears.

The Lorentz program is written in literate Java and is free software. For source and Java byte code, download the Lorentz.jar file.