Relative velocity and closing speed - Eli Bendersky's website
Toggle navigation
Eli Bendersky's website
About
Projects
Archives
In Physics simulations or game engines it’s sometimes useful to<br>determine the speed with which two objects are approaching each other.<br>This post will discuss the concept of closing speed, which is the<br>normal component of the relative velocity of two objects.
Relative velocity and its components
Suppose we have objects A and B [1] with velocity vectors<br>\vec{V_A} and \vec{V_B}. The relative velocity of B<br>w.r.t. A is:
\[\vec{V}_{B|A}=\vec{V}_B-\vec{V}_A\]<br>Put differently, it’s the velocity of B in A’s frame of reference.
This relative velocity is a vector, and we can split it into orthogonal<br>components. Obviously, the nature of such a split depends on the basis<br>we want to use. We could look at the vector’s x an y components (we’ll<br>be using - two dimensional space, but everything<br>here applies to 3D as well), but for this post we’re interested in<br>something slightly different:
We draw a line connecting the two objects. The component of<br>\vec{V}_{B|A} in the direction of this line is called the<br>normal component of relative velocity, while the component<br>perpendicular to this direction is called the tangential component.
Computing the normal component
How do we find the component of a vector in the direction of a specific<br>line? By using a vector<br>projection!.<br>We’ll represent the line by a vector, and find the projection of<br>\vec{V}_{B|A} onto this vector.
The positions of A and B can also be seen as vectors: \vec{P}_A<br>and \vec{P}_B. The line connecting them can then be expressed as<br>the vector \vec{P}_B-\vec{P}_A:
All we need from this position difference vector is its direction, not<br>its magnitude, however [2]. So we’ll use the unit vector of<br>\vec{P}_B-\vec{P}_A, denoted as:
\[\widehat{P}=\frac{\vec{P}_B-\vec{P}_A}{|\vec{P}_B-\vec{P}_A|}\]<br>Finally, to find the projection of \vec{V}_{B|A} onto<br>\widehat{P}, we compute [3]:
\[S_c=\vec{V}_{B|A}\cdot\widehat{P}=(\vec{V}_B-\vec{V}_A)\cdot\widehat{P}\]<br>Where the multiplication operator between the vectors is the dot<br>product. Note that the result of the dot product is a scalar;<br>therefore, the quantity S_c is called the closing speed - it<br>expresses the rate at which the relative distance of the two objects is<br>changing. If it’s positive, the objects are drifting farther apart; if<br>it’s negative, the objects are getting closer together. Therefore the<br>term "closing speed" may be slightly confusing; alternatively, this has<br>been called a "signed separation speed", or "normal relative speed" [4].
The signs in these calculations can be tricky to get right, so we have<br>to be very careful. Let’s see a few examples that will help us make<br>these computations more concrete.
Examples
To build up some intuition and get some practice with the equations,<br>we’ll review the following examples:
Example I : We’ll start by computing the relative position unit<br>vector \widehat{P}:
\[\widehat{P}=\frac{\vec{P}_B-\vec{P}_A}{|\vec{P}_B-\vec{P}_A|}=\frac{\langle 4,0\rangle}{|\langle 4,0 \rangle|}=\langle1,0\rangle\]<br>Then, the closing speed is:
\[S_c=(\vec{V}_B-\vec{V}_A)\cdot\widehat{P}=\langle -3,0\rangle\cdot\langle1,0\rangle=-3\]<br>Based on our convention, the negative sign of S_c means that the<br>objects are approaching each other. Due to the simple nature of the<br>example, this result is easy to verify, as it can be immediately guessed<br>just by looking at the diagram.
Example II : Here \widehat{P} is the same as in the previous<br>example. The closing speed is:
\[S_c=(\vec{V}_B-\vec{V}_A)\cdot\widehat{P}=\langle 3,0\rangle\cdot\langle1,0\rangle=3\]<br>Same magnitude, but different sign from before, because the objects are<br>moving farther apart.
Example III This example is to demonstrate that we get consistent<br>results even if B is to the left of A. Here the relative position unit<br>vector is:
\[\widehat{P}=\frac{\vec{P}_B-\vec{P}_A}{|\vec{P}_B-\vec{P}_A|}=\frac{\langle -2,0\rangle}{|\langle -2,0 \rangle|}=\langle-1,0\rangle\]<br>And the closing speed:
\[S_c=(\vec{V}_B-\vec{V}_A)\cdot\widehat{P}=\langle 3,0\rangle\cdot\langle -1,0\rangle=-3\]<br>Which is the same as in example I, as expected. The direction of<br>\widehat{P} flipped, but so did the direction of the relative<br>velocity vector, so the result has the same sign.
Example IV : Finally, an example showing more arbitrary positions and<br>velocities.
\[\widehat{P}=\frac{\vec{P}_B-\vec{P}_A}{|\vec{P}_B-\vec{P}_A|}=\frac{\langle 3,4\rangle}{|\langle 3,4 \rangle|}=\langle0.6,0.8\rangle\]<br>Then:
\[S_c=(\vec{V}_B-\vec{V}_A)\cdot\widehat{P}=\langle -3,-6\rangle\cdot\langle 0.6,0.8\rangle=-6.6\]<br>This example is a good opportunity to demonstrate something important<br>about S_c: it’s time-dependent, because positions change with<br>time. Here, -6.6 is the closing speed at the exact moment when A’s and<br>B’s positions and velocities are as stated in the example. In the next<br>time step, the position of A will be \langle2,5\rangle and...