Assume you're in outer-space and a spaceship flies past you at a very high speed. In the ship, the pilot is shooting a light beam from the ground to the ceiling, and a mirror on the ceiling reflects the beam back to the ground. The pilot sees the beam move in a straight line going up and down, but you would see the beam moving in a triangle path going up then down (due to the ship quickly flying past you).
The speed of light is constant, but the length of the beam is shorter for the pilot moving at fast speeds than it is for you. Therefore, the pilot's time must be running slower than yours, in order to satisfy v = d/t
Does this analogy verify that time dilation and length contraction happen when moving at faster speeds? A book I was reading used this thought experiment to prove time dilation, but it seems like it also proves length contraction as well.