In purely Newtonian physics, the concept of relative velocity is a comparatively simple one. Lacking any objective frame of reference, we simply define some object's position as a baseline, measuring position and velocity from that viewpoint. The notation I use is **v**_{ab}, where **a** is the object being viewed and **b** is our reference position. Let our reference position be `(X`_{0} , Y_{0} , Z_{0}).

We observe object 1, at: `(X`_{1} , Y_{1} , Z_{1}).

The relative velocity of object one will be, then:

`v`_{10} = d/dt(X_{1} - X_{0} , Y_{1} - Y_{0} , Z_{1} - Z_{0})

From Position 2, separate from Positions 0 and 1, we can define:

`v`_{02} = d/dt(X_{0} - X_{2} , Y_{0} - Y_{2} , Z_{0} - Z_{2})

`v`_{12} = d/dt(X_{1} - X_{2} , Y_{1} - Y_{2} , Z_{1} - Z_{2})

To switch reference frames, then, we can calculate:

`v`_{10} = v_{12} - v_{02}

`v`_{01} = v_{02} - v_{12}

Relativity complicates matters considerably, and I may add a treatment later. Feel free to write your own.