Relative velocity from points' point of view Edit: The terminology might be imprecise. Please pay attention to the picture I drew to explain my problems. I will appreciate an edit that will ensure the terminology is no longer disputable.
This must be a simple problem but I can't figure an equation for it. Consider two moving points, $A$ and $B$. We know their positions and velocities, but we want to observe them from $A$'s point of view. I will make examples in 1D, but I need to solve this problem in two dimensions.
What I know is that relative position can be calculated by subtraction:
$$pos_{relA} = pos_B - pos_A$$
Relative velocity depends on position. This image illustrates it:

You can see that albeit the velocities of the objects are same on both images, the relative velocity is different. Relative velocity clearly depends on relative position of the two objects. Relative velocity between two points is also same for both of the points.
In my image, relative velocity is positive when distance between points is increasing. That's not necessary.
How to calculate relative velocity of two points?

What you are looking for is the derivative of the distance between points with respect to time, that is their relative radial velocity. If $r=\sqrt{(x_B-x_A)^2}$ then
$$
v_{rel}={dr\over dt}={(x_B-x_A)\cdot(v_B-v_A)\over r}.
$$
Notice that this also works if $x_A$ and $x_B$ are vectors: in that case you have a dot product in the numerator.
