Time Dilation – The math
In the stationary frame we observe the light going straight up and down. However in the moving frame as the light bounces between the mirrors the mirrors move some distance so the path taken by the light is at an angle (like a triangle).