Relative Velocity Calculator: One and Two Dimensions
Relative Velocity Calculator, 1-D and 2-D
The velocity of A relative to B is vA − vB — a vector subtraction, component by component, never a subtraction of speeds. Two cars at 20 and 15 m/s can approach at 35 m/s, separate at 5 m/s, or close at 25 m/s, and the only thing that decides which is the geometry.
Relative velocity: A as seen from B
Car A drives due north at 20 m/s. Car B drives due east at 15 m/s. What is the velocity of A as seen by the driver of B?
One vector subtraction, and the two scalars people use instead
- vA
- velocity of A measured in the ground frame, in m/s.
- vB
- velocity of B in the same ground frame. B is the observer: the frame you are moving into.
- vAB
- velocity of A as measured by B. Written vAB, and the order of the subscripts is the order of the subtraction.
- vBA
- velocity of B relative to A, which is −vAB: same magnitude, opposite direction.
- θ
- the angle between the two ground velocities. The relative speed is √(vA² + vB² − 2vAvBcos θ) — the cosine rule, which is the same statement in trigonometry.
Worked example
Car A drives due north at 20 m/s. Car B drives due east at 15 m/s. What is the velocity of A as seen by the driver of B?
Write both as components, east first. vA = (0, 20) m/s, because due north has no eastward part. vB = (15, 0) m/s.
Subtract component by component. vAB = (0 − 15, 20 − 0) = (−15, 20) m/s. The eastward component is negative, which says B’s driver sees A moving to the west as well as to the north.
Take the magnitude. |vAB| = √(15² + 20²) = √625 = 25.0 m/s. The 15-20-25 triangle is the 3-4-5 scaled up, which is why this is the version every textbook sets.
Take the direction. The bearing anticlockwise from east is arctan(20/−15) resolved into the second quadrant, which is 126.87° — that is 36.87° west of due north. A driver of B looking at A sees it crossing from right to left as well as moving away.
Check the limits. The two ground speeds are 20 and 15, so the relative speed must lie between 5 (same direction) and 35 (exactly opposite). 25 sits between them, which it must, and it equals neither — so neither “add the speeds” nor “subtract the speeds” would have given it.
And the reverse. The velocity of B relative to A is (15, −20) m/s: still 25.0 m/s, bearing −53.13°, which is exactly opposite. The speed is symmetric; the direction is not.
Why you subtract vectors and not speeds: one pair of cars, three answers
| What you might do | Arithmetic | Answer | Is it the relative speed? |
|---|---|---|---|
| Add the speeds | 20 + 15 | 35 m/s | Only if they move in exactly opposite directions. |
| Subtract the speeds | 20 − 15 | 5 m/s | Only if they move in exactly the same direction. |
| Subtract the vectors | (0,20) − (15,0) = (−15,20) | 25 m/s | Yes, for these perpendicular velocities. |
The four one-dimensional cases, with east as positive
| Situation | vA | vB | vA − vB | What B sees |
|---|---|---|---|---|
| Both east, A faster | +20 | +15 | +5 | A pulling ahead slowly, at 5 m/s. |
| Both east, B faster | +15 | +20 | −5 | A falling behind at 5 m/s — the sign is the only difference. |
| Head-on | +20 | −15 | +35 | A approaching at 35 m/s. This is why a head-on collision is so much worse than a rear-end one at the same speeds. |
| B at rest | +20 | 0 | +20 | The ground-frame answer. A stationary observer is the special case, not the general one. |
| Identical velocities | +20 | +20 | 0 | A appears motionless. Relative speed zero does not mean either is at rest. |
| A at rest, B moving east | 0 | +15 | −15 | A appears to B to be moving west at 15 m/s. B’s own motion shows up, reversed, in everything B looks at. |
| Both west | −20 | −15 | −5 | A pulling ahead westwards at 5 m/s. Both signs negative, and the answer is still a difference. |
Why the observer is a frame, and why the order of the subscripts matters
Every velocity is measured relative to something. “20 m/s north” is shorthand for “20 m/s north relative to the ground”, and the ground has no special claim on the measurement — it is just the frame nobody bothers to name. Relative velocity is what happens when you name a different one. Asking for the velocity of A relative to B means asking what A looks like to someone who considers themselves at rest, and the recipe is to subtract B’s velocity from everything in sight.
The subtraction is a vector subtraction and that is the entire difficulty. Component by component: east minus east, north minus north. Then, if the question wants a speed, take the magnitude of what is left; if it wants a direction, take the arctangent. Doing it the other way round — subtracting the magnitudes and then wondering about direction — gives the right answer only when the two velocities are parallel, which is exactly the one-dimensional case and exactly why one-dimensional practice can hide the misunderstanding for years.
The order of the subscripts is the order of the subtraction. vAB means “A relative to B” and equals vA − vB; the second subscript is the observer. Get them the wrong way round and you obtain the exact negative — the same speed pointing the opposite way — which is often harmless in a magnitude question and completely wrong in a direction one. A useful mnemonic is that the subscripts cancel like fractions: vAB + vBC = vAC.
Three bounds are worth carrying in your head, because they catch most arithmetic errors instantly. The relative speed can never be less than the difference of the two ground speeds, and never more than their sum. It equals the difference when the two move in the same direction, equals the sum when they move in exactly opposite directions, and lies strictly between for everything else. So two objects at 20 and 15 m/s have a relative speed somewhere in 5 to 35 m/s, and any answer outside that is wrong before you check anything else.
Relative velocity is not the rate at which a gap closes. This is the subtlest point on the page. The relative velocity tells you how the displacement between two objects changes, as a vector. Whether the distance between them is growing or shrinking depends on where they are as well as how they are moving: two objects with a relative velocity of 25 m/s can be approaching, receding, or momentarily neither, according to the angle between that relative velocity and the line joining them. The rate of change of separation is the component of the relative velocity along that line. Questions about collisions and closest approach need the positions; questions about what one observer measures need only the velocities, which is all this page has.
Two shortcuts are safe and one is not. It is safe to put yourself in B’s frame by subtracting B’s velocity from everything in the problem, including a third object, the wind and the ground — that is a consistent change of frame and every relative velocity between the remaining objects is unchanged by it. It is also safe to use the cosine rule on the triangle of the two velocities rather than resolving into components, which is often quicker when the question gives you an angle rather than components. What is not safe is subtracting B’s speed from A’s speed and keeping A’s direction, which is what a one-dimensional habit tempts you into; it gives the right answer for parallel velocities and a wrong one for every other case.
A word on why the relative speed is symmetric but the direction is not. Subtracting vectors is not commutative: vA − vB and vB − vA differ by a sign, and a sign on a vector is a reversal of direction and not a change of length. So the two observers always agree on how fast the other is going and always disagree, by exactly 180°, on which way. That is worth carrying because it makes half of the arithmetic free: compute one relative velocity and you have both.
One notation warning. Some textbooks write vAB to mean “the velocity of A relative to B” and others write vBA for the same thing, reading the subscripts as “from B to A”. The convention on this page, and the more common one, is that the second subscript names the observer, so vAB = vA − vB. If a question’s own notation is ambiguous, write out “velocity of the car as seen from the lorry” in words before you subtract anything. Getting it backwards costs nothing on a speed and everything on a direction.
The classic applications all come down to naming the frame. Rain that falls vertically appears to slant towards a walker because in the walker’s frame the rain has acquired a backwards horizontal component equal and opposite to the walking velocity. A boat crossing a river has to aim upstream because its velocity relative to the water, added to the water’s velocity relative to the bank, must come out perpendicular to the bank. An aircraft’s heading and its track differ by exactly the wind. In every case the step that makes the problem tractable is drawing the two vectors head-to-tail and reading the third side of the triangle — which is the cosine rule, and the same statement as the component subtraction this page performs.
The river-crossing problem is the one worth working through in full, because it has two different questions hiding in it. “What heading gets me straight across?” requires the boat’s velocity relative to the water to have an upstream component exactly cancelling the current, so sin of the upstream angle is the current speed over the boat speed — and no such angle exists if the current is faster. “What heading gets me across quickest?” has a different answer: point straight across, because the crossing time depends only on the component of velocity perpendicular to the bank, and aiming upstream wastes some of it. The quickest crossing and the straightest crossing are different headings, and a question that does not say which it wants is testing whether you noticed.
Frequently asked questions
Why can I not just subtract the two speeds?
Because speed is a magnitude and velocity is a vector, and subtracting magnitudes throws away the directions. It happens to work when the two velocities are parallel: same direction gives the difference, opposite directions gives the sum. For anything in between it gives a number that is too small. Two cars at 20 and 15 m/s at right angles have a relative speed of 25 m/s — not 5, and not 35. Subtract the components first, then take the magnitude.
Is the velocity of A relative to B the same as B relative to A?
The speeds are identical; the directions are exactly opposite. vBA = −vAB. So if the driver of B sees A moving at 25 m/s on a bearing 126.9° from east, the driver of A sees B moving at 25 m/s on a bearing −53.1°. A question that asks only for a relative speed does not care which way round you did it; one that asks for a velocity or a direction cares a great deal.
What does a relative velocity of zero mean?
That the two objects have identical velocities, so each sees the other hanging motionless alongside. It does not mean either one is at rest — two aircraft in formation at 250 m/s have a relative velocity of zero. This is the condition that makes mid-air refuelling possible and the reason you can pour a drink on a cruising train: in your own frame, the train is not moving.
Does a relative velocity tell me whether two objects will collide?
Not on its own. The relative velocity tells you how the vector between the two objects changes; whether they get closer depends on where they are now. The rate at which the separation changes is the component of the relative velocity along the line joining them, so two objects can have a large relative velocity and a constant separation if that velocity is perpendicular to the line. Collision and closest-approach questions need the starting positions as well, which is why they are usually set as a separate, longer problem.
Why does vertical rain look slanted when I walk?
Because you are asking what the rain looks like in your frame, and in your frame the rain has your velocity subtracted from it. Rain falling at 5 m/s straight down, seen by somebody walking east at 1.5 m/s, has a relative velocity of 1.5 m/s west and 5 m/s down — so it appears to come from in front, at about 17° from the vertical. Tilt the umbrella into the apparent direction, not the real one. Put this page in two-dimensional mode with the rain as A and yourself as B and it gives exactly that.
How does this work for a boat crossing a river?
The boat’s velocity relative to the bank is its velocity relative to the water plus the water’s velocity relative to the bank — the subscripts cancel. To go straight across, the two must add to something perpendicular to the bank, which means the boat must point upstream by an angle whose sine is the current speed divided by the boat speed. If the current is faster than the boat, there is no such angle and a straight crossing is impossible, which the sine refusing to exceed one tells you automatically.
Is there a shortcut when the question gives an angle instead of components?
Yes: the cosine rule. The relative speed is √(vA² + vB² − 2vAvBcos θ), where θ is the angle between the two ground velocities. For 20 and 15 m/s at 90° the cosine term vanishes and you get √625 = 25 m/s, matching the component method. At 0° it gives the difference and at 180° the sum, which is where the two bounds on this page come from. The components are still needed if the question wants a direction.
Related calculators
References
- NCERT, Physics: Textbook for Class XI, Part I, Chapter 2 “Motion in a Straight Line”, §2.4 “Kinematic Equations for Uniformly Accelerated Motion”. Derives the three equations writing v0 for the initial velocity and x for the displacement, and takes g as 9.8 m s−2 (10 m s−2 in Example 2.3).
- BIPM, The International System of Units (SI), 9th edition (2019). Definitions of the metre and the second, and the convention that the radian is the coherent SI unit of plane angle with dimension one — which is why every trigonometric formula in mechanics is written in radians.
- OCR, Data, Formulae and Relationships Booklet for AS and A Level GCE Physics A (H156 and H556), 8 pages. Lists the acceleration of free fall as g = 9.81 m s−2 alongside the thirteen other physical constants the papers assume.
- NIST, CODATA Internationally Recommended Values of the Fundamental Physical Constants — complete listing. The standard acceleration of gravity is tabulated as 9.806 65 m s−2, marked exact rather than carrying an uncertainty.
physics.nist.gov/cuu/Constants/
