The relative velocity is the velocity of an object or observer in the rest frame of another object or observer. If it is constant

v_AB=〖-v〗_AB

In the Newtonian limit where the Galilean transformation is approximately:

r=r-vt

t'=t

This holds true and is identical with the vector difference between the velocities A and B as evaluated in terms of a single coordinate system:

v_AB= v_B- v_A

Due to Einstein’s Special Relativity, this does not hold true in general. The expression “the velocity of A relative to B” is shorthand for “the velocity of A in the coordinate system where B is always at rest.

To obtain vAB from vA and vB in an arbitrary reerence frame, the Lorentz transformation is necessary. If vA and vB are collinear, the formula is:

v_AB= (v_B- v_A)/(1- (v_A v_B)/c^2 )