The difference between relative velocity and closing speed

In physics simulations and game engines, it’s often useful to determine the rate at which two objects are approaching or receding from each other. That quantity is the closing speed, defined as the normal component of the relative velocity vector — the component that points along the line connecting the two objects.

Given objects A and B with velocity vectors v_A and v_B, the relative velocity of B with respect to A is:

v_rel = v_B - v_A

This is the velocity of B as seen from A’s frame of reference. We can split v_rel into orthogonal components using any basis, but the useful split here is along the line connecting A and B. The component along that line is the normal component; the perpendicular one is the tangential component.

Finding the normal component with projections

The normal component is simply the projection of v_rel onto the direction defined by the position difference vector:

r_rel = r_B - r_A

Since we only care about direction, we normalize it to get the unit vector:

r_hat = r_rel / |r_rel|

The closing speed is the dot product of the relative velocity with this unit vector:

closing_speed = v_rel · r_hat

The result is a signed scalar. A positive value means the objects are drifting apart; a negative value means they are getting closer. The sign convention can be confusing — “closing speed” is really a signed separation speed, also sometimes called the normal relative speed.

Walkthrough examples

Concrete examples help make the sign conventions and computations clear.

Example I: A at (0,0), B at (1,0), with velocities v_A = (0,0) and v_B = (-1,0).

The unit relative position vector is:

r_hat = (1,0)

The closing speed is:

v_rel · r_hat = (-1,0) · (1,0) = -1

The negative sign indicates the objects are approaching each other, which is immediately obvious from the diagram.

Example II: Same positions, but now v_B = (1,0).

The closing speed is:

(1,0) · (1,0) = 1

Same magnitude, opposite sign — the objects are moving apart.

Example III: B is to the left of A, so A at (0,0) and B at (-1,0), with v_A = (0,0) and v_B = (1,0).

Now:

r_hat = (-1,0)
v_rel · r_hat = (1,0) · (-1,0) = -1

The result matches Example I. The direction of r_hat flipped, but so did the relative velocity, so the sign of the product remains consistent.

Example IV: More arbitrary positions and velocities, say A at (0.5, 0.2) moving with (2,0) and B at (0.7, 0.5) moving with (-1,0).

This demonstrates an important subtlety: r_hat is time-dependent because positions change with time. The computed closing speed of, say, -6.6 is only valid at the exact instant the positions and velocities are as stated. One time step later, r_hat will be different even if velocities stay constant.

Closing speed as a function of time

The instantaneous calculation above is a static snapshot. We can generalize it with the standard physical interpretation of velocity, treating positions as functions of time:

r_A(t), r_B(t)

The relative position vector is then:

r_rel(t) = r_B(t) - r_A(t)

The scalar distance is its magnitude:

d(t) = |r_rel(t)|

What we want is d'(t) — the rate of change of distance over time. Expanding:

d(t) = sqrt(r_rel(t) · r_rel(t))

Applying the chain rule:

d'(t) = (1/d(t)) * r_rel(t) · r_rel'(t)

Since r_rel'(t) = v_rel(t) (velocity is the derivative of position), this becomes:

d'(t) = v_rel(t) · r_hat(t)

This is the same equation as before, but written explicitly as a function of time. The time-dependence of every quantity is now made clear, which is more precise than the instantaneous formulation and avoids any confusion about when the computed closing speed applies.