# How to get velocity of observer? (Special Relativity)

An observer O at rest midway between two sources of light at x=0 and x=10m observes the two sources to flash simultaneously. According to a second observer O’, moving at a constant speed parallel to the x-axis, one source of light flash 13ns before the other. Which of the following gives the speed of O’ relative to O?

I had tried time dilation but, my answer was wrong. I also searched for answer. I found it. But,

How did he find the equation?

The equation that is used in your linked answer $$t^\prime = \gamma \left(t - \frac{v}{c^2}x\right)$$ comes from the Lorentz-transformations for the time variable.
The "time dilation" formula you are thinking of ($$t'=\gamma t$$ ?) accounts for the time interval between two events (your flashes of light) which occur at the same location in the rest frame of the events. If the events occur at different locations, you must use the full Lorentz transformation of the event timing.
That equation is the Lorentz transformation from the unprimed frame to a frame moving relative to it with velocity $$v$$ in the positive $$x$$ direction, and their origins coincide with each other at $$t=t'=0$$.