I already worked out the coordinate transformation for the train going at 80% of the speed of light, so it will be convenient to use that as our starting point. And let's have the man inside the train shoot a bullet at 80% of the speed of light. Obviously in Gallilean relativity the observer on the ground will see the bullet moving at 1.6 times the speed of light. But how does it work in relativity?
We already worked out that the coordinates of the point (0,1) moved to (4/3, 5/3) in the coordinate system of the moving train. And similarly for the point (1,0) which moves to (5/3, 4/3). (Remember, that any Lorentz transformation maps points along the trajectory of a hyperbola.) From these pieces of information, we can actually re-draw the entire coordinate system like so:
You should be able to verify that the equations I've written do indeed map points from the (x,t) coordinate system (the stationary system) to the (x', t') system (the moving system).
You should know that coordinate transformations of this kind can be written in matrix notation. We're going to do that, and the look at what happens to a point that is transformed twice: first, a stationary point that is transformed to the moving train, and then the same transformation applied within the moving train. On the graph, it looks like so:
Applying the transformation once moves the vector from a to b; and applying it again moves the vector from b to c. We can do this by matrix multiplication: