In short

The velocity of object A as seen by object B is the relative velocity: \vec{v}_{AB} = \vec{v}_A - \vec{v}_B. In one dimension, this reduces to a simple subtraction with signs. In two dimensions, you subtract the velocity vectors component-by-component. Relative velocity is the key to solving train-crossing problems, minimum-distance-of-approach questions, and every situation where "how fast?" depends on who is watching.

You are sitting in a Rajdhani Express moving at 130 km/h. A Shatabdi Express on the next track races past in the opposite direction at 150 km/h. For that half-second of blurred windows, the Shatabdi seems to scream past at a terrifying speed — much faster than 150 km/h. But someone standing on the platform sees it pass at exactly 150 km/h, no more.

Who is right? Both of you. You measured a different velocity because you are watching from a different place — a moving train instead of a stationary platform. The Shatabdi's speed has not changed. What changed is your motion, and that changed what you observed. This is the heart of relative motion: every velocity measurement is made from some vantage point, and the answer depends on which vantage point you choose.

Physics calls that vantage point a reference frame. The platform is one frame. Your train seat is another. The Shatabdi's pantry car is a third. Each frame is equally valid, and each gives a different velocity for the same object. There is no "true" velocity — there is only velocity relative to a chosen frame.

Reference frames — choosing your vantage point

A reference frame is a coordinate system attached to an observer. When you say "the car is moving at 60 km/h," you mean 60 km/h relative to the ground. The ground is your reference frame. You do not normally say this out loud because the ground is the default — everyone around you is standing on it. But the moment you sit inside a moving train, the ground is no longer the obvious frame, and ambiguity creeps in.

Any object can serve as a reference frame: the ground, a train, a boat, a cyclist, the Sun. The only requirement is that you define a coordinate origin and a set of axes attached to that object. Once you do, every position, velocity, and acceleration you measure is "as seen from that frame."

For the problems in this article, all frames move at constant velocity relative to each other — no acceleration, no rotation. These are called inertial reference frames, and Newton's laws hold in every one of them. The physics is the same; only the numbers change.

Relative velocity — the subtraction rule

Suppose two cars, A and B, are driving along a straight highway. Car A moves at velocity \vec{v}_A and car B at velocity \vec{v}_B, both measured by a traffic camera fixed to the ground.

What is the velocity of A as seen by someone sitting in B?

Think of it this way. You are in car B. The ground is sliding backward under you at speed v_B — but you do not notice that, because your frame moves with B. Everything you see has B's motion subtracted out. A tree on the roadside, which is stationary to the traffic camera, appears to move backward at v_B from your point of view. And car A, which the camera sees at v_A, appears to you at:

\vec{v}_{AB} = \vec{v}_A - \vec{v}_B

Why: when you sit in B's frame, you subtract B's velocity from everything. The ground goes from 0 to -\vec{v}_B. Car A goes from \vec{v}_A to \vec{v}_A - \vec{v}_B. This subtraction is the frame transformation from the ground frame to B's frame.

This is the fundamental formula of relative motion. Read the subscript carefully: \vec{v}_{AB} means "velocity of A relative to B" — the velocity of A as measured by B. The first subscript is the object you are asking about; the second is the observer.

A useful symmetry: the velocity of B relative to A is \vec{v}_{BA} = \vec{v}_B - \vec{v}_A = -\vec{v}_{AB}. If you see B approaching you at 50 km/h, then B sees you approaching at 50 km/h in the opposite direction. The magnitudes are equal; the directions are opposite.

One-dimensional relative motion — same line, two objects

When two objects move along the same straight line, the vector subtraction simplifies to ordinary subtraction with signs. Set up a sign convention — say, rightward (or the direction of travel) is positive — and every velocity is just a signed number.

Same direction

Two autorickshaws on MG Road: rickshaw A at +30 km/h, rickshaw B at +20 km/h, both heading north.

v_{AB} = v_A - v_B = 30 - 20 = +10 \text{ km/h}

Why: A is faster, so from B's viewpoint, A slowly pulls ahead at 10 km/h. The positive sign says A moves in the positive direction (northward) relative to B — which makes sense, since A is overtaking B.

From A's viewpoint, B falls behind:

v_{BA} = v_B - v_A = 20 - 30 = -10 \text{ km/h}

The negative sign means B appears to drift southward (backward) at 10 km/h. Both observers agree on the magnitude (10 km/h) but disagree on the direction — as the symmetry rule guarantees.

Opposite directions

An Indian Railways express train heading north at +90 km/h passes a goods train heading south at -60 km/h (negative because southward).

v_{AB} = v_A - v_B = 90 - (-60) = 90 + 60 = +150 \text{ km/h}

Why: when two objects move toward each other, their relative speed is the sum of their individual speeds. This is why the Shatabdi in the opening seemed so fast — your Rajdhani's speed added to it.

This is the formula behind every "two trains approaching each other" problem. The gap between them closes at 150 km/h, even though neither train moves that fast on its own.

Relative velocity in 1D: same vs opposite direction Top panel shows two arrows pointing right at 30 and 20 km/h with relative velocity 10 km/h. Bottom panel shows arrows pointing in opposite directions at 90 and 60 km/h with relative velocity 150 km/h. Same direction A 30 km/h B 20 km/h v꜀ᴬᴮ = 10 km/h → Opposite directions A 90 km/h B 60 km/h v꜀ᴬᴮ = 150 km/h
Same direction: relative velocity is the difference of speeds. Opposite directions: relative velocity is the sum of speeds.

The crossing-time formula

When two objects approach each other along a line, the time to cross depends on the total length to be covered and the relative speed.

Two trains of lengths L_1 and L_2 approach each other on parallel tracks. From the instant the engines meet, the trains are "crossing" each other until the tail of one passes the engine of the other. The total distance covered during this crossing is L_1 + L_2 — because both trains must completely pass each other. The speed at which this gap closes is the relative speed |v_{AB}|.

t_{\text{cross}} = \frac{L_1 + L_2}{|v_{AB}|}

Why: in B's frame, B is stationary and A approaches at |v_{AB}|. Train A must cover a distance equal to the sum of both train lengths to completely clear B. Time = distance / speed.

If two trains move in the same direction (overtaking), the crossing distance is still L_1 + L_2, but the relative speed is smaller (|v_A - v_B|), so the overtaking takes much longer than crossing from opposite directions.

Two-dimensional relative motion — vector subtraction

Real motion is not always along a line. A boat crosses a river while the current pushes it sideways. A plane flies northeast while the wind blows from the west. Two cars approach an intersection from perpendicular roads. In all these situations, the velocities point in different directions, and you must use vector subtraction.

The formula is the same:

\vec{v}_{AB} = \vec{v}_A - \vec{v}_B

But now \vec{v}_A and \vec{v}_B are vectors with components:

\vec{v}_A = v_{Ax}\,\hat{i} + v_{Ay}\,\hat{j}
\vec{v}_B = v_{Bx}\,\hat{i} + v_{By}\,\hat{j}

Subtract component by component:

(v_{AB})_x = v_{Ax} - v_{Bx}
(v_{AB})_y = v_{Ay} - v_{By}

Why: vector subtraction works independently on each component. The x-components subtract to give the x-component of the relative velocity, and the y-components do the same. This is why you resolved vectors into components in the first place — it turns a vector problem into two scalar problems.

The magnitude of the relative velocity is:

|\vec{v}_{AB}| = \sqrt{(v_{AB})_x^2 + (v_{AB})_y^2}

And the direction (angle with the x-axis):

\tan \theta = \frac{(v_{AB})_y}{(v_{AB})_x}

The vector triangle

There is a neat geometric way to see the subtraction. Draw \vec{v}_A and \vec{v}_B from the same point. The vector from the tip of \vec{v}_B to the tip of \vec{v}_A is \vec{v}_{AB} = \vec{v}_A - \vec{v}_B.

Vector triangle for relative velocity subtraction Three vectors from a common origin O: v_A pointing upper right, v_B pointing right, and v_AB drawn from the tip of v_B to the tip of v_A, completing the triangle. O v⃗꜀ᴬ v⃗꜀ᴮ v⃗꜀ᴬᴮ v⃗꜀ᴬᴮ = v⃗꜀ᴬ − v⃗꜀ᴮ
To find $\vec{v}_{AB}$, draw $\vec{v}_A$ and $\vec{v}_B$ from the same origin. The relative velocity vector runs from the tip of $\vec{v}_B$ to the tip of $\vec{v}_A$.

This triangle is your best friend in 2D relative velocity problems. Instead of decomposing into components, you can often use the geometry of the triangle directly — applying the cosine rule when the angle between the velocities is known, or using Pythagoras when the velocities are perpendicular.

Minimum distance of approach

Two objects move in straight lines that do not intersect. At some instant they are far apart; they approach each other, reach a minimum separation, and then move apart again. Finding that minimum distance is a classic relative-velocity problem.

The trick is to work in the frame of one object. Say object B is your frame. In B's frame, B is stationary at a point, and A moves in a straight line at the relative velocity \vec{v}_{AB}. The minimum distance between A and the stationary B is simply the perpendicular distance from B to A's straight-line path.

Minimum distance of approach using relative velocity In B's reference frame, B is stationary at a point. A moves along a straight line at relative velocity v_AB. The minimum distance is the perpendicular from B to A's path. B (stationary in its own frame) A (initial) v⃗꜀ᴬᴮ d꜀ₘᵢₙ closest point
In B's frame, A travels in a straight line. The minimum distance $d_{\min}$ is the perpendicular from B to that line.

How to compute d_{\min}:

Step 1. Find the relative velocity \vec{v}_{AB} = \vec{v}_A - \vec{v}_B.

Why: in B's frame, A moves at \vec{v}_{AB} in a straight line. B sits at the origin, unmoving.

Step 2. Find the initial relative position \vec{r}_{AB}(0) = \vec{r}_A(0) - \vec{r}_B(0). This is the vector from B to A at time t = 0.

Why: in B's frame, A starts at this position and then moves along the direction of \vec{v}_{AB}.

Step 3. The position of A relative to B at time t is:

\vec{r}_{AB}(t) = \vec{r}_{AB}(0) + \vec{v}_{AB}\,t

The distance squared is:

d^2(t) = |\vec{r}_{AB}(t)|^2 = |\vec{r}_{AB}(0) + \vec{v}_{AB}\,t|^2

Step 4. Minimise d^2 by differentiating with respect to t and setting the derivative to zero:

\frac{d}{dt}[d^2] = 2\,\vec{r}_{AB}(0) \cdot \vec{v}_{AB} + 2\,|\vec{v}_{AB}|^2\,t = 0
t_{\min} = -\frac{\vec{r}_{AB}(0) \cdot \vec{v}_{AB}}{|\vec{v}_{AB}|^2}

Why: this is the time at which A is closest to B. The dot product \vec{r}_{AB}(0) \cdot \vec{v}_{AB} captures how much of the initial separation is along the direction of approach. Dividing by |\vec{v}_{AB}|^2 converts that into a time.

Step 5. The minimum distance is:

d_{\min} = |\vec{r}_{AB}(0) + \vec{v}_{AB}\,t_{\min}|

Or, geometrically, d_{\min} is the perpendicular distance from B to the line of A's relative motion. You can compute this using the cross product:

d_{\min} = \frac{|\vec{r}_{AB}(0) \times \vec{v}_{AB}|}{|\vec{v}_{AB}|}

Why: |\vec{a} \times \vec{b}| = |\vec{a}||\vec{b}|\sin\theta gives the area of the parallelogram formed by \vec{a} and \vec{b}. Dividing by the base |\vec{b}| gives the height, which is the perpendicular distance.

This approach — switching to one object's frame — is far simpler than tracking both objects in the ground frame. In B's frame, the problem reduces to finding the distance from a point to a line, which is basic geometry.

Worked examples

Example 1: Two trains approaching on parallel tracks

Two Indian Railways trains approach each other on adjacent parallel tracks. Train A (Rajdhani Express, length 420 m) moves east at 60 km/h. Train B (Duronto Express, length 540 m) moves west at 90 km/h. Find (a) the velocity of A relative to B, and (b) the time they take to completely cross each other.

Two trains approaching each other on parallel tracks Train A moves east at 60 km/h, Train B moves west at 90 km/h. The relative velocity is 150 km/h eastward. Total crossing distance is 420 + 540 = 960 m. Ground frame A (420 m) 60 km/h B (540 m) 90 km/h In B's frame B (stationary) A (420 m) 150 km/h
Top: both trains in the ground frame. Bottom: in B's frame, B is stationary and A approaches at 150 km/h — the sum of their speeds.

Step 1. Set up a sign convention. Take east as positive.

v_A = +60 km/h (eastward), v_B = -90 km/h (westward).

Why: B moves west, which is the negative direction in our convention. Getting the sign right is essential — a wrong sign here gives the wrong relative velocity.

Step 2. Compute the relative velocity of A with respect to B.

v_{AB} = v_A - v_B = (+60) - (-90) = +150 \text{ km/h}

Why: subtracting a negative is adding. Since the trains approach each other, their speeds add. The positive sign tells you that A moves eastward relative to B — in B's frame, A rushes toward B from the west.

Step 3. Convert the relative speed to m/s for the crossing-time calculation.

150 \text{ km/h} = 150 \times \frac{1000}{3600} = 41.67 \text{ m/s}

Step 4. Find the total distance to be covered during crossing.

d = L_A + L_B = 420 + 540 = 960 \text{ m}

Why: "completely crossing" means the tail of one train passes the engine of the other. The entire length of both trains must sweep past each other.

Step 5. Calculate the crossing time.

t = \frac{d}{|v_{AB}|} = \frac{960}{41.67} = 23.0 \text{ s}

Why: in B's frame, B is stationary and A approaches at 41.67 m/s. A must cover 960 m at that speed. Time = distance / speed.

Result: The velocity of A relative to B is 150 km/h eastward. The two trains take 23.0 seconds to completely cross each other.

What this shows: When two objects approach from opposite directions, you add their speeds to get the relative speed. The crossing time follows directly from the total length divided by this relative speed.

Example 2: Two cars at an intersection — 2D relative velocity

Car A travels north at 40 km/h along NH-48. Car B travels east at 30 km/h along a perpendicular road. Find the velocity of A relative to B — both magnitude and direction.

Vector diagram for 2D relative velocity of two perpendicular cars Car A moves north (up) at 40 km/h, car B moves east (right) at 30 km/h. The relative velocity v_AB is found by subtracting v_B from v_A. The vector diagram shows v_A pointing up, negative v_B pointing left, and v_AB as the diagonal of magnitude 50 km/h at 53.1 degrees west of north. East North v⃗꜀ᴬ = 40 km/h v⃗꜀ᴮ = 30 km/h −v⃗꜀ᴮ = 30 km/h west v⃗꜀ᴬᴮ = 50 km/h θ
$\vec{v}_A$ points north, $\vec{v}_B$ points east. To subtract $\vec{v}_B$, reverse it (pointing west) and add to $\vec{v}_A$. The resultant $\vec{v}_{AB}$ points northwest at 50 km/h, making an angle $\theta = 36.9°$ west of north.

Step 1. Set up coordinates. Let east = +\hat{i}, north = +\hat{j}.

\vec{v}_A = 0\,\hat{i} + 40\,\hat{j} \text{ km/h}
\vec{v}_B = 30\,\hat{i} + 0\,\hat{j} \text{ km/h}

Why: A moves purely north (only a \hat{j} component), B moves purely east (only an \hat{i} component). No mixing of components.

Step 2. Subtract to find the relative velocity.

\vec{v}_{AB} = \vec{v}_A - \vec{v}_B = (0 - 30)\,\hat{i} + (40 - 0)\,\hat{j} = -30\,\hat{i} + 40\,\hat{j} \text{ km/h}

Why: the x-component is 0 - 30 = -30 (westward), and the y-component is 40 - 0 = +40 (northward). In B's frame, A appears to move northwest — combining A's northward motion with a westward drift caused by B's own eastward motion.

Step 3. Find the magnitude.

|\vec{v}_{AB}| = \sqrt{(-30)^2 + 40^2} = \sqrt{900 + 1600} = \sqrt{2500} = 50 \text{ km/h}

Why: this is Pythagoras — the two components are perpendicular, so the magnitude is the hypotenuse. Notice the 3-4-5 right triangle: 30, 40, 50. This is not a coincidence — the problem was designed with these numbers.

Step 4. Find the direction.

\tan \theta = \frac{30}{40} = 0.75 \implies \theta = \arctan(0.75) = 36.9°

The direction is 36.9° west of north (or equivalently, 53.1° north of west).

Why: the angle is measured from the north (+\hat{j}) axis toward the west (-\hat{i}) axis, since the x-component is negative (west) and the y-component is positive (north).

Result: From B's viewpoint, car A moves at 50 km/h in a direction 36.9° west of north.

What this shows: Even though neither car moves faster than 40 km/h, the relative velocity is 50 km/h — the vector subtraction can produce a magnitude larger than either individual speed when the velocities point in different directions.

Common confusions

If you are comfortable with relative velocity in 1D and 2D, the worked examples, and the minimum-distance method, you have the tools for most problems. What follows explores the formal structure of reference frame transformations and connects relative motion to Galilean relativity — useful for JEE Advanced and for understanding why Einstein had to replace these ideas at high speeds.

Galilean transformation

When you switch from frame S (the ground) to frame S' (moving at velocity \vec{V} relative to S), every position and velocity transforms as:

\vec{r}' = \vec{r} - \vec{V}\,t
\vec{v}' = \vec{v} - \vec{V}
\vec{a}' = \vec{a}

Why: position shifts by \vec{V}\,t because the origin of S' has moved that far from S's origin. Velocity transforms by subtracting \vec{V} — this is exactly the relative velocity formula. Acceleration is unchanged because \vec{V} is constant, so its time derivative is zero.

The fact that \vec{a}' = \vec{a} is the reason Newton's laws work in all inertial frames. If \vec{F} = m\vec{a} in frame S, then \vec{F} = m\vec{a}' in frame S' too, because the acceleration is the same. Forces do not depend on the frame — only velocities do.

This set of equations is called the Galilean transformation. It is named after Galileo, who first articulated the idea that a person below deck on a smoothly sailing ship cannot tell, from any mechanical experiment, whether the ship is moving or at anchor. Every experiment gives the same result — because the laws of mechanics are the same in every inertial frame.

When does Galilean relativity break down?

At speeds comparable to the speed of light (c = 3 \times 10^8 m/s), the Galilean transformation gives wrong answers. If a car moves at 0.6c and flashes its headlights, the Galilean formula predicts the light moves at 1.6c relative to the ground. But experiments show that light always moves at exactly c, regardless of the source's motion. This contradiction led Einstein to replace the Galilean transformation with the Lorentz transformation, which reduces to the Galilean version at low speeds. For everything in this article — trains at 150 km/h, cars at 50 km/h, boats on the Ganga — the Galilean transformation is perfect.

Relative acceleration

If both objects accelerate, the relative acceleration is:

\vec{a}_{AB} = \vec{a}_A - \vec{a}_B

If \vec{a}_A = \vec{a}_B (for example, both objects are in free fall under gravity), then \vec{a}_{AB} = 0 — the relative motion is uniform, even though each object individually accelerates. This is why one freely falling object sees another freely falling object as stationary (or moving in a straight line at constant speed). It is also why astronauts on the ISS appear to float relative to the station, even though both are accelerating toward Earth at about 8.7 \text{ m/s}^2.

Minimum distance of approach — the calculus-free version

For two objects A and B with position vectors \vec{r}_A(0) and \vec{r}_B(0) at t = 0, moving at constant velocities \vec{v}_A and \vec{v}_B, the minimum distance can be written as:

d_{\min} = \frac{|\vec{r}_{AB}(0) \times \vec{v}_{AB}|}{|\vec{v}_{AB}|}

where \vec{r}_{AB}(0) = \vec{r}_A(0) - \vec{r}_B(0) and \vec{v}_{AB} = \vec{v}_A - \vec{v}_B.

In 2D, the cross product |\vec{a} \times \vec{b}| simplifies to |a_x b_y - a_y b_x|. So the formula becomes:

d_{\min} = \frac{|(r_{AB})_x (v_{AB})_y - (r_{AB})_y (v_{AB})_x|}{|\vec{v}_{AB}|}

Why: this is just the formula for the perpendicular distance from a point (B's position) to a line (A's path in B's frame). The cross product gives the area of the parallelogram, and dividing by the base gives the height. No calculus needed — it is pure geometry in disguise.

This formula is a favourite in JEE Advanced problems. The hardest part is getting the initial relative position vector right — draw a diagram with explicit coordinates before plugging in numbers.

Where this leads next