v_AB = v_A - v_Bread as “the velocity of A as measured by B”  ·  subtract east and north components  ·  relative speed = sqrt(east x east + north x north)  ·  bearings run clockwise from north

Relative velocity is the velocity one body has as another body measures it, and working it out is a subtraction rather than a comparison of speeds: v_AB = v_A - v_B, taken component by component. This free relative velocity calculator takes both velocities in one common frame — a speed and a compass bearing each — and returns the relative speed, the bearing it points along, its east and north components, the reverse view v_BA, and the plain difference of the two speeds with a note on whether that difference is the answer. The one-dimensional cases come out of the same arithmetic: give both bodies the same bearing for the same-direction case, and bearings 180 degrees apart for the head-on case.

v_AB = v_A - v_B means the velocity of A as measured by B. Textbooks genuinely disagree about which subscript comes first, so this page states its reading once and never swaps it: A is the body being watched and B is the observer. Bearings run clockwise from north — 0 north, 90 east, 180 south, 270 west — so the east component takes the sine, the north component the cosine, and both velocities must already be measured in the same frame before you type them, which on this page is called the ground frame.

Load a real pair of motions

Every button writes all four boxes in their default units, metres per second and degrees, so the state is complete the moment you press it. The line underneath quotes back whatever the widget works out from that, so nothing in it is stored text.

Pick a pair above, or type your own numbers.

What Is the Relative Velocity Calculator?

The relative velocity calculator is a free online tool for the velocity one moving body has as a second moving body measures it. Both velocities go in as a speed and a compass bearing, measured against one shared reference, and the tool returns the relative speed together with the direction it points along. The arithmetic is a vector subtraction done one component at a time, which is the only operation that respects the fact that a velocity carries a direction as well as a size.

The quantity it returns is written v_AB, and on this page that means the velocity of A as measured by B: the first letter is the body being watched and the second is the body watching. Textbooks genuinely disagree about which subscript comes first, so the reading is printed in the formula band, on both field labels, under the widget and in the working rather than left to be guessed. Reading it the other way round gives v_BA, which has the same size on the opposite bearing, and that reverse view is printed beside every answer so both readings are on screen at once.

Bearings here run clockwise from north, so 0 is north, 90 east, 180 south and 270 west, and the east component of a velocity takes the sine of its bearing while the north component takes the cosine. That is the navigator's convention rather than the mathematician's: the vector addition calculator on this site measures its angles anticlockwise from the positive x-axis and therefore exchanges the sine for the cosine. Both are correct and the two are not interchangeable, so it is worth knowing which one is in front of you before comparing an answer with a textbook.

There is one solve direction and no mode menu, because none is needed. Giving both bodies the same bearing produces the same-direction case, where the answer is the difference of the two speeds, and setting the bearings 180 degrees apart produces the head-on case, where the answer exceeds either speed on its own. Two cars at 100 and 80 kilometres per hour illustrate both in one click: travelling the same way their relative speed is 20 kilometres per hour, and turned to face one another it is 180.

Five readings sit beside the answer. The first is the bearing of the relative velocity, which is the direction the watched body appears to move in once the observer is treated as standing still; the second is the pair of east and north components, which are the two subtractions the working performs; the third reprints the same relative speed in kilometres per hour and miles per hour.

The fourth reading is the reverse view, and the fifth is the one most worth looking at. It prints the plain difference of the two speeds and says whether that difference is the answer, because a relative speed is not a difference of speeds except in the one case most people picture: motion along a single line, in the same sense. Rain falling at 8 metres per second seen from a bicycle moving at 6 shows the gap at its clearest, with a relative speed of 10 metres per second against a difference of speeds of 2.

A relative speed of exactly zero is a valid answer rather than an error: two bodies with the same velocity travel together, and neither sees the other move at all. In that state the direction reading shows a dash rather than a figure, because a vector of zero length has no direction to report and the arctangent of zero over zero would otherwise publish a confident bearing of due north. Any component smaller than a billionth of the largest one on screen is treated as zero as well, which is how two bodies entered on bearings of 0 and 360 are recognised as travelling together.

Every answer stops at four significant figures with the trailing zeros kept, so a drift angle reads 13.50 degrees rather than 13.5. That is a ceiling chosen for consistency rather than a limit of the data, since every input is an exact value somebody typed. The working prints its own operands with more figures than that on purpose, because a subtraction cancels leading digits and two nearly equal velocities would otherwise leave a difference whose last printed digit was noise.

Two entries are declined in words instead of being answered: a negative speed, and anything large enough to parse as infinity. A speed is a magnitude, so a negative one is really a bearing 180 degrees round, and the tool asks for the bearing rather than guessing; an infinity has to be tested for explicitly, because it passes a sign test. A bearing outside 0 to 360 is not refused, because a bearing is a direction rather than a quantity, so 450 behaves exactly as 90 does.

What the tool does not do, it says. There is no closing speed, no separation, no river crossing time, no downstream drift, no heading correction and no relativistic composition anywhere on the page, and none of those is an oversight: a closing speed needs the positions of the two bodies, a crossing time needs the width of the water, and a heading correction needs an inverse sine. The difference between a relative speed and a closing speed is the sharpest of those: two aircraft flying north on parallel tracks a kilometre apart, at 200 and 150 metres per second, have a relative speed of 50 metres per second while the gap between them changes at zero metres per second at the instant they are abreast; a moment later the faster aircraft is ahead and the separation is growing.

Variables used by the relative velocity calculator
SymbolQuantityDefault unitAlso acceptsExample value
v_ASpeed of A, the body being watchedm/skm/h, mph27.78
dir ABearing of A, clockwise from north°degrees only90
v_BSpeed of B, the observerm/skm/h, mph22.22
dir BBearing of B, clockwise from north°degrees only90

How to use the relative velocity calculator

  1. Decide which body is A and which is B. v_AB = v_A - v_B is the velocity of A as measured by B, so A is what you are watching and B is where you are watching from. Swapping them keeps the speed and flips the direction by 180 degrees.
  2. Type the speed of A. It takes m/s, km/h or mph and opens on 27.78 m/s. It is a speed, so it is never negative — the direction belongs in the bearing box.
  3. Type the bearing of A. Degrees clockwise from north: 0 north, 90 east, 180 south, 270 west. Nothing is wrapped, so 450 behaves exactly like 90.
  4. Type the speed and bearing of B. The same two boxes for the observer, and both velocities must be measured in the same frame first. The defaults put B on 22.22 m/s due east.
  5. Read the relative speed. The headline is the magnitude of v_AB in metres per second, to four significant figures. A relative speed of exactly zero is a valid answer, not an error.
  6. Read the relative direction chip. The bearing of v_AB, clockwise from north. It shows an em dash when the relative speed is zero, because a zero vector has no direction.
  7. Read the components chip. The east and north components of v_AB — the two subtractions the working does. The next chip reprints the same relative speed in km/h and mph.
  8. Read the difference-of-speeds chip. It prints the plain difference of the two speeds and says whether that is the relative speed. On Rain and cyclist the two read 10 m/s and 2.000 m/s.
  9. Open Show working. Resolve both velocities on the compass axes, subtract componentwise, recombine with Pythagoras. Three steps, with the operands printed at enough figures to reproduce the next line.

This page exists for one step: turning two velocities in one frame into the velocity of one as measured by the other. The relative velocity guide is the prose half of it, with the river crossing and the wind triangle worked line by line, eight problems and the misconceptions in full. The distinction this tool rests on — that a velocity carries a direction while a speed does not — belongs to the velocity and speed guide, and nothing here re-teaches it.

Three mistakes account for most wrong answers here. Reading v_AB the other way round — as the velocity of B measured by A — reverses the bearing by 180 degrees, which is why the reverse view is a chip rather than a footnote. Subtracting the two speeds instead of the two velocities is the next, and the last chip prices it on every state; typing a negative speed to mean “the other way” is the third, and the page declines it and asks for a bearing instead.

Relative velocity calculator on its defaults: A at 27.78 m/s on a bearing of 90 degrees and B at 22.22 m/s on a bearing of 90 degrees return a headline relative speed of 5.56 m/s, with chips reading a relative direction of 90.00 degrees, components of 5.560 east and 0.000 north, 20.02 km/h and 12.44 mph, a reverse view of 5.560 m/s on a bearing of 270.0 degrees, and a difference of the two speeds of 5.560 m/s.
The page as it opens: two cars on one road, 27.78 m/s and 22.22 m/s due east, giving 5.56 m/s on a bearing of 90.00°. The chip to watch is the last one — here the difference of the two speeds really is the relative speed, because the motions are collinear and in the same sense.

Worked example: change one thing at a time

The table starts at the defaults, flips one bearing to get the head-on case, swaps the bodies over, then walks through trains, aircraft, rain and a right-angle crossing before reaching the entries the calculator declines. Rows 1 to 4 are one pair of cars seen four ways. Every figure in the last three columns was read out of the running widget rather than worked out by hand, so where a cell and the tool ever part company, believe the tool.

What the calculator reports as the bearings, the speeds and the unit menus change
Case What you type Relative speed Relative direction In other units
The page as it opens: two cars, same way down one road vA 27.78 m/s at 90, vB 22.22 m/s at 90 5.56 m/s 90.00° 20.02 km/h, 12.44 mph
The same two cars, typed into the km/h menu vA 100 km/h at 90, vB 80 km/h at 90 5.556 m/s 90.00° 20.00 km/h, 12.43 mph
The same pair head-on: one bearing flipped vB bearing 270 instead of 90 50 m/s 90.00° 180.0 km/h, 111.8 mph
Head-on again, typed in km/h vA 100 km/h at 90, vB 80 km/h at 270 50 m/s 90.00° 180.0 km/h, 111.8 mph
Row 1 with the two bodies swapped over vA 22.22 m/s at 90, vB 27.78 m/s at 90 5.56 m/s 270.0° 20.02 km/h, 12.44 mph
Two trains overtaking on parallel tracks vA 120 km/h at 90, vB 90 km/h at 90 8.333 m/s 90.00° 30.00 km/h, 18.64 mph
A passenger walking forward along a train vA 21.5 m/s at 0, vB 20.0 m/s at 0 1.5 m/s 0.000° 5.400 km/h, 3.355 mph
The same passenger walking back down the carriage vA 18.5 m/s at 0, vB 20.0 m/s at 0 1.5 m/s 180.0° 5.400 km/h, 3.355 mph
Two aircraft flying north on parallel tracks vA 200 m/s at 0, vB 150 m/s at 0 50 m/s 0.000° 180.0 km/h, 111.8 mph
Rain as a cyclist sees it, in a vertical plane vA 8.00 m/s at 180, vB 6.00 m/s at 90 10 m/s 216.9° 36.00 km/h, 22.37 mph
A right-angle crossing: the 3-4-5 triangle vA 4.00 m/s at 0, vB 3.00 m/s at 90 5 m/s 323.1° 18.00 km/h, 11.18 mph
An aircraft in a crosswind, worked in the air frame vA 250 km/h at 0, vB 60 km/h at 270 71.42 m/s 13.50° 257.1 km/h, 159.8 mph
Travelling together: identical velocities vA 15.0 m/s at 45, vB 15.0 m/s at 45 0 m/s — 0.000 km/h, 0.000 mph
The same bearing written as 360 instead of 0 vA 12.0 m/s at 0, vB 12.0 m/s at 360 0 m/s — 0.000 km/h, 0.000 mph
A bearing of 450 is a bearing of 90 vA 27.78 m/s at 450, vB 22.22 m/s at 90 5.56 m/s 90.00° 20.02 km/h, 12.44 mph
A negative bearing is still a direction vA 27.78 m/s at -270, vB 22.22 m/s at 90 5.56 m/s 90.00° 20.02 km/h, 12.44 mph
Both bodies at rest vA 0 m/s, vB 0 m/s 0 m/s — 0.000 km/h, 0.000 mph
B at rest, so v_AB is just the velocity of A vA 27.78 m/s at 90, vB 0 m/s 27.78 m/s 90.00° 100.0 km/h, 62.14 mph
A at rest, so v_AB is the velocity of B reversed vA 0 m/s, vB 22.22 m/s at 90 22.22 m/s 270.0° 79.99 km/h, 49.70 mph
Both speeds typed into the mph menu vA 60 mph at 90, vB 55 mph at 90 2.235 m/s 90.00° 8.047 km/h, 5.000 mph
A negative speed for A is declined vA -5 m/s no answer - -
A negative speed for B is declined vB -1 m/s no answer - -
An entry that parses to infinity is declined vA 1e400 no answer - -
A bearing that parses to infinity is declined the bearing of A set to 1e400 no answer - -

Rows 1 to 4 are the whole topic in four lines. Two cars travelling the same way at 27.78 and 22.22 m/s give 5.56 m/s; turn the second one round, change nothing else, and the answer becomes 50 m/s. The sign of the second velocity is the entire difference between those two readings, and in the km/h rows it is worth exactly twice the 80: 20.00 km/h against 180.0 km/h.

Rows 1 and 2 are the same pair of cars and they do not agree in the last figure, which is published rather than hidden. The preset carries 27.78 and 22.22 m/s, the four-figure roundings of 100 and 80 km/h, and their difference is 5.56 exactly — three figures, because a subtraction cancels the leading ones. Typing 100 and 80 into the km/h menu instead returns 5.556 m/s, which is 20.00 km/h, and that is the figure the guide quotes.

Row 20 is the same demonstration in the other menu. Two vehicles at 60 and 55 mph give 2.235 m/s, and the other-units chip reads that straight back as 5.000 mph. A mile per hour is 0.44704 metres per second exactly, so nothing is lost on the way through.

Row 5 is the convention, made visible. Swap the two bodies and the relative speed is unchanged at 5.56 m/s while the bearing moves from 90.00° to 270.0°. That is the antisymmetry v_AB = -v_BA, and it is why the reverse view chip exists: whichever way round you read the subscripts, the other reading is on screen.

Rows 6 to 8 are the one-dimensional cases people actually meet. Two trains at 120 and 90 km/h have a relative speed of 8.333 m/s, which is 30.00 km/h — the figure an overtaking time divides the combined length by, because for two bodies in line the relative speed and the rate the gap closes are the same number. A passenger walking at 1.5 m/s along a 20.0 m/s train has a ground speed of 21.5 or 18.5 m/s, and either way this page recovers the walking speed as 1.5 m/s — forward on a bearing of 0.000°, backward on 180.0°.

Rows 7 and 8 are also the clearest look at the trailing zero. The headline reads 1.5 m/s and the chips read 1.500 m/s, which is the same number: the engine's headline formatter drops a trailing zero and the chips keep it, because four significant figures is a claim about precision rather than a typing habit.

Rows 9 to 12 are the two-dimensional cases, and they are where subtracting speeds falls apart. Two aircraft flying north at 200 and 150 m/s give 50 m/s due north. Rain falling at 8.00 m/s and a cyclist riding at 6.00 m/s give 10 m/s on 216.9° — and the difference of those two speeds is 2.000 m/s, a fifth of the answer.

Row 10 reads the plane vertically rather than horizontally, and that is a relabelling you have to make on purpose. The two bearings become 0 for straight up and 180 for straight down, and the components chip then reads -6.000 east, -8.000 north: 6.00 m/s forwards for every 8.00 m/s downwards, which is a tilt of 36.87° from straight down. The page itself knows nothing about which plane you meant — it subtracts two vectors on one plane and the naming is yours.

The tilt comes from the components rather than from the bearing, and that is worth doing deliberately. The bearing chip is already rounded to 216.9°, so subtracting the 180° of straight down from it gives 36.9° rather than the 36.87° the triangle really has. Taking the arctangent of the two printed components instead reproduces the published figure exactly.

Row 11 is the 3-4-5 triangle, and it is one body watched from another crossing its path at right angles. A at 4.00 m/s north against B at 3.00 m/s east gives 5 m/s on 323.1°, which is the velocity of A as measured by B: B's eastward velocity is subtracted, so the bearing swings 36.87° to the west of A's own course. Read B as a river and that reading is the boat as the water measures it, not the boat as the bank sees it.

A boat aimed straight across a downstream current is carried downstream, and that is the other diagonal of the same rectangle. Its velocity over the ground is the two velocities added — 4.00 m/s across plus 3.00 m/s with the flow — which comes to 5.00 m/s on a track tilted 36.87° downstream of straight across. This page subtracts and only subtracts, so that track is the guide's figure rather than row 11's, and the two magnitudes agree only because the two vectors are mirror images of one another.

Row 12 is the wind triangle worked in the air's frame, where the ground slides west at 60 km/h while the aircraft holds 250 km/h due north. The headline reads 71.42 m/s because the output is always in metres per second, and the other-units chip turns it into 257.1 km/h on a bearing of 13.50°. Those two are the ground speed and the drift angle, and the heading correction that would cancel the drift is a different, slightly larger angle this page does not compute.

Rows 13, 14 and 17 are the degenerate states, and every one of them is a valid answer rather than an error. Identical velocities give 0 m/s and a relative direction of —, because a zero vector has no direction to report. Writing one bearing as 360 and the other as 0 gives the same thing, which it only does because any component below a billionth of the largest one is taken as zero.

Rows 15 and 16 are the bearings the page does not tidy up. A bearing of 450° is 90° and a bearing of -270° is 90°, so both return 5.56 m/s on 90.00°, and nothing warns you that what you typed was unconventional. A bearing is a direction rather than a quantity, so there is no range to be outside of.

Rows 18 and 19 are the two ways of having one body at rest. With B stationary the relative velocity is simply the velocity of A, 27.78 m/s on 90.00°; with A stationary it is the velocity of B reversed, 22.22 m/s on 270.0°. Those two are the sense in which a velocity measured against the ground is already a relative velocity, with the ground as the observer.

Rows 21 to 24 sit outside the domain and are declined there rather than answered. A negative speed is refused because a speed is a magnitude and the direction belongs in the bearing box; an entry large enough to parse as infinity is refused as well, which has to be tested for explicitly because Infinity > 0 is true and a sign test alone would publish it. The result area prints the reason instead of a figure, so the last two columns of those rows are hyphens.

One thing the table cannot show is what the page does not refuse. Two velocities that are physically impossible together — a 240 m/s cyclist, a 0.9c car — are subtracted as readily as any others, because the arithmetic has no idea what the bodies are. Recognising that is the reader's job and not the widget's.

Formula and symbol reference

One line does all the work. Resolve each velocity into components, subtract them, and recombine: v_AB = v_A - v_B componentwise, then the relative speed is sqrt(east x east + north x north) and the relative direction is atan2(east, north). There is no rearrangement and no second mode, because the one-dimensional cases are already in here — equal bearings give the same-direction case and bearings 180 degrees apart give the head-on case.

The subscript order is a convention and this page states it rather than assuming it. v_AB = v_A - v_B reads “the velocity of A as measured by B”, so A is watched and B observes; some textbooks write the same quantity the other way round, so it is always worth checking a source before trusting a sign. The reverse view v_BA has the same magnitude on the opposite bearing, which is the antisymmetry the order encodes.

Bearings here run clockwise from north, which is not the convention of the neighbouring tool. On this page east = speed x sin(bearing) and north = speed x cos(bearing); the vector addition calculator measures its angles anticlockwise from the positive x-axis and therefore exchanges the sine for the cosine. Both are correct, neither is interchangeable with the other, and that page is also where components and resultants are properly taught — the scalar and vector quantities guide is the prose version, and this page uses components without re-teaching them.

Two quantities that often get attached to this formula are not computed here. A closing speed is the part of v_AB that points along the line joining the two bodies, so it needs their positions: two aircraft flying north on parallel tracks 1000 m apart at 200 and 150 m/s have a relative speed of 50 m/s while the gap between them changes at 0 m/s in that instant. A crossing time or a drift needs the width of the river, which is the same missing field, and the velocity calculator is where a distance and a time become a speed.

Symbols, units and the figures this page uses them with
Symbol Meaning SI unit Values used on this page
v_A The velocity of the body being WATCHED, measured in the common frame. It goes in as a speed and a bearing, never as a negative speed metre per second Boxes take m/s, km/h or mph: 27.78 m/s is the default, which is 100 km/h and 62.14 mph.
v_B The velocity of the OBSERVER, in the same frame. Treating B as stationary is exactly what subtracting its velocity does metre per second Boxes take m/s, km/h or mph: 22.22 m/s is the default, which is 79.99 km/h and 49.70 mph.
dir A, dir B The two bearings, in degrees CLOCKWISE FROM NORTH: 0 north, 90 east, 180 south, 270 west. Nothing is wrapped, so 450 behaves as 90 and -270 does too degree The defaults are 90 and 90, which is two bodies both heading due east.
v_AB The relative velocity: the velocity of A as measured by B. The headline is its magnitude, the relative speed, and the first chip is its bearing metre per second The headline: 5.56 m/s at the defaults, 50 m/s head-on, 10 m/s for rain and a cyclist.
v_BA The reverse view, the velocity of B as measured by A. It is the same magnitude on the opposite bearing, which is the antisymmetry the subscript order encodes metre per second A chip: 5.560 m/s on a bearing of 270.0° at the defaults, against 90.00° for v_AB.
east, north The two components of v_AB, each one a single subtraction. Flipping a bearing by 180 degrees changes the sign of what is being subtracted, which is why a head-on pair adds metre per second A chip: 5.560 east and 0.000 north at the defaults; -6.000 east and -8.000 north for rain and a cyclist.
Relative velocity calculator on the Rain and cyclist preset: A at 8.00 m/s on a bearing of 180 degrees and B at 6.00 m/s on a bearing of 90 degrees return a headline relative speed of 10 m/s, with chips reading a relative direction of 216.9 degrees, components of -6.000 east and -8.000 north, 36.00 km/h and 22.37 mph, a reverse view of 10.00 m/s on a bearing of 36.87 degrees, and a difference of the two speeds of 2.000 m/s which is not the relative speed.
The two-dimensional case, and the misconception priced in one screen: the relative speed is 10 m/s while the difference of the two speeds is 2.000 m/s. The components of -6.000 and -8.000 are the 3-4-5 triangle again — read the plane vertically and that is rain arriving 36.87° from straight down, which is the tilt an umbrella needs.

The physics: why changing your point of view changes the numbers and nothing else

Two bodies move. Write each velocity down in one common frame, and the velocity either one has as measured by the other is fixed by that pair alone: v_AB = v_A - v_B. Subtracting B's velocity is the arithmetic of sitting in B and calling yourself stationary.

The reason it is a subtraction and not a comparison of speeds is that a velocity has a direction. Resolving both velocities into components and subtracting them pair by pair is the only operation that respects that, which is why the working has a resolve step at all. The velocity and speed guide is where the scalar and vector distinction belongs, and the vector addition calculator is where the component machinery is taught.

Add the same velocity to both bodies and the answer does not move. That is the most useful property of this formula: (v_A + u) - (v_B + u) is still v_A - v_B, so a common motion cancels exactly. Two passengers walking down the same train agree about each other whether the train is standing still or doing 200 km/h, and there is no frame in which either of them is really moving.

The second thing the formula says is the one most people have backwards. Turning one body round does not change its speed, but it changes the sign of the velocity being subtracted, which is why a head-on pair gives a bigger answer than either body's own speed. Press Same direction and then Head-on and the headline goes from 5.56 m/s to 50 m/s with one bearing altered.

The third thing is hiding in the last chip. The relative speed equals the plain difference of the two speeds only when the two motions are collinear and in the same sense, which is the one case a reader already pictures. On Rain and cyclist the relative speed is 10 m/s against a difference of speeds of 2.000 m/s, and the chip says which is which on every state rather than leaving it to be noticed.

Where the relative velocity calculator breaks down

The arithmetic here is exact to the last digit a double can hold, and a subtraction has nothing to go wrong in it. What is limited is the model: one instant, two bodies, constant velocities, one flat plane, and no positions at all.

No positions, so no closing speed and no separation
This page takes two velocities and nothing else, so it cannot tell you how fast the gap between the bodies is changing. That quantity is the projection of v_AB on the line joining them, and it needs their positions: two aircraft flying north on parallel tracks 1000 m apart at 200 and 150 m/s have a relative speed of 50 m/s while their separation changes at 0 m/s at the instant they are abreast, and a moment later the faster one is ahead and the gap is growing. Put the same pair in line instead and the two figures coincide at 50 m/s, which is exactly why the terms get muddled.
One instant, and constant velocities
Both velocities are read as fixed, so the answer describes this moment and no other. If either body is accelerating, the relative velocity changes from instant to instant and nothing here follows it: that is the acceleration guide, and the SUVAT calculator is where a changing velocity is worked out. There is no time field on this page and no history behind the answer.
One flat plane, and you choose what it means
Two components is all there is, so this is a plane rather than a space. Nothing stops you reading that plane vertically — the Rain and cyclist preset does exactly that, with 0 for straight up and 180 for straight down — but the page cannot tell which reading you meant and will keep calling the axes east and north. A genuinely three-dimensional pair of velocities, an aircraft climbing while another descends, cannot be entered here at all.
Both velocities must already be in the same frame
The formula subtracts two velocities measured against one common reference, called the ground frame here. Two figures from different frames — an airspeed and a ground speed, a speed over water and a speed over the seabed — cannot be subtracted directly, and the page has no way of knowing you have mixed them. The crosswind row of the table shows the honest way through it: pick one frame, express both velocities in that frame, then subtract.
Galilean only, and that stops being true near the speed of light
At everyday speeds the subtraction is not approximately right but right to fourteen digits: for two vehicles meeting head-on at 100 and 80 km/h the relativistic correction is a fractional 6.868e-15, which is the product of the two speeds over c squared. Near light speed it fails completely — two craft at 0.800c head-on would give 1.600c by subtraction, which is not a velocity at all, where the correct composition gives 0.9756c. The four-figure precision of this page survives until each body passes roughly 0.007c, about 2,120 km/s, and the theory behind that belongs to the special relativity guide rather than to this tool.
Four significant figures, and the fourth one can disappear from the headline
Every computed figure here stops at four significant figures, which is a ceiling chosen for the cluster rather than a limit of the data: every input is an exact value you typed. The engine's headline formatter drops a trailing zero where the chips keep it, so the same answer reads 1.5 m/s above and 1.500 m/s beside it. Nothing is lost — the chips are the four-figure form — but the two strings are worth recognising as one number.
A subtraction cancels digits, and the working says so by printing more of them
When two velocities nearly agree, the difference is much smaller than either of them and the leading figures cancel away. Four-figure operands would then print a difference whose last digit was noise, so the working carries seven significant figures plus one for every decade the cancellation costs. That is why an ordinary state shows 27.78 in the working while a near-cancelling one shows rather more.
Float dust is snapped to zero, nine decades below anything printed
The sine of 180 degrees is 1.2246e-16 rather than 0 in any computer, so a body heading due south carries an east component of about 1e-15 m/s. Left alone, two bodies on bearings 0 and 360 would report a relative speed of 2.4e-15 m/s on a bearing of 90 degrees instead of zero with no direction. Anything below a billionth of the largest component on screen is therefore taken as exactly zero, which is far below the four figures this page publishes but is still a rule rather than a fact of arithmetic.
A zero relative velocity has no direction, and the page refuses to invent one
Identical velocities give a relative speed of exactly zero, which is a perfectly physical answer: the two bodies travel together. The direction chip then shows an em dash rather than a figure, because atan2(0, 0) returns 0 in every language and would publish a confident bearing of due north. The reverse view chip drops its bearing in the same state and for the same reason.
Bearings are not tidied up and negative speeds are declined
A bearing of 450° or -270° is accepted and treated as 90°, and nothing on the page warns you that it was unconventional. A negative speed is declined instead, because a speed is a magnitude: typing -5 m/s to mean “the other way” is really a bearing 180 degrees round, and the page asks for that rather than guessing. An entry that parses to infinity is refused too.
The calculator measures nothing — you supply the numbers
Two velocities go in, one subtraction happens, and the answer describes the pair you described. The preset names are shorthand for the four figures behind them and are not claims about any particular road, aircraft or weather.

Where the relative velocity calculator is actually used

Overtaking and the arithmetic of one road
The commonest question on this topic is one-dimensional, and it is the state the page opens in. Two cars travelling the same way at 100 and 80 km/h have a relative speed of 5.556 m/s, which is 20.00 km/h; turn one round and it becomes 50 m/s, or 180.0 km/h. Two trains at 120 and 90 km/h give 8.333 m/s, which is the figure an overtaking time divides the combined length by.
Air navigation: the wind triangle, worked in one frame
An aircraft holding 250 km/h through the air with a 60.0 km/h crosswind is two velocities in one frame, and the crosswind row of the table does it: in the air's frame the ground slides west at 60 km/h, so the velocity of the aircraft relative to the ground comes out at 257.1 km/h on a bearing of 13.50°. That bearing is the drift angle, the amount the wind pushes the aircraft off course if the pilot does nothing. The heading correction needed to cancel it is a different and slightly larger angle, and it needs an inverse sine this page has no box for.
Marine navigation and the river crossing
A boat and a current are two velocities in one frame, and row 11 subtracts them: 4.00 m/s north against 3.00 m/s of eastward flow gives 5 m/s on 323.1°, which is the boat as the water measures it and not the boat as the bank sees it. The track over the bank runs the other way, 36.87° downstream of straight across at 5.00 m/s, which is those two velocities added rather than subtracted and so is not what row 11's entries return. The same subtraction answers the ferry, the swimmer and anything else moving through moving water, provided both velocities are expressed in the same frame; the ground track, the crossing time and the drift belong to the guide rather than to this page.
The angle to hold an umbrella at
Rain falling at 8.00 m/s looks different from a bicycle moving at 6.00 m/s: the apparent speed is 10 m/s and the components are -6.000 east, -8.000 north, which read vertically is 6.00 forwards for every 8.00 down — a tilt of 36.87° from straight down. That is why the rain appears to come at you from in front, and why an umbrella has to lean into the motion rather than sit upright. It is also the clearest everyday case where the relative speed is bigger than either of the two speeds involved.
Changing frames to make a problem easier
Many two-body problems get simpler the moment one body is treated as stationary, which is what subtracting its velocity does. A passenger walking along a train, a cyclist in rain, a boat in a current and an aircraft in wind are all the same arithmetic in four different frames. Adding a common velocity to both bodies changes nothing at all, so choosing the convenient frame costs nothing in accuracy.
Checking a figure someone else has quoted
Relative speeds are easy to misquote, because the two obvious wrong answers — the difference of the speeds and the sum of the speeds — are each right in exactly one special case. Typing both velocities here settles it in one reading, and the difference-of-speeds chip shows at a glance whether the shortcut would have worked. Where a quoted figure and this page disagree, the bearings are usually where the disagreement lives.
Sizing the next quantity on a neighbouring tool
This page stops at one relative velocity at one instant. The velocity calculator turns a distance and a time into a speed, the acceleration calculator handles a velocity that is changing, and the physics lab library has the interactive versions of all of this. The tools listed at the foot of the page take the same pair of motions on to momentum, to frequency shifts and to the equations of motion.
Relative velocity calculator on the Travelling together preset: A and B both at 15.0 m/s on a bearing of 45 degrees return a headline relative speed of 0 m/s, with the relative direction chip showing an em dash rather than a bearing, components of 0.000 east and 0.000 north, 0.000 km/h and 0.000 mph, a reverse view of 0.000 m/s and no direction, and a difference of the two speeds of 0.000 m/s.
The degenerate state, and it is an answer rather than an error: identical velocities give a relative speed of 0 m/s, and the relative direction shows — because a zero vector has no direction. Computing atan2(0, 0) there would print a confident bearing of due north.

Where to go next

For the river crossing and the wind triangle worked line by line, eight problems of rising difficulty and the misconceptions in full, read the relative velocity guide, which this tool is the arithmetic half of. The velocity and speed guide is the scalar and vector distinction this page rests on, and the scalar and vector quantities guide is where components and resultants are properly taught.

Three more guides pick up what this page deliberately leaves out. The acceleration guide is what happens when a velocity will not hold still, the elastic and inelastic collisions guide is where a relative velocity of approach reverses in a collision, and the Doppler effect guide is where a relative velocity between source and observer shifts a frequency.

Two more take the speed limit seriously. The special relativity guide is where subtracting velocities stops working, and the time dilation guide is what replaces it.

Five tools sit next to this one. The vector addition calculator adds two vectors where this page subtracts them; the velocity calculator turns a distance and a time into a speed; the SUVAT calculator and the acceleration calculator handle a velocity that is changing; and the Doppler effect calculator is where a relative velocity shifts a frequency.

The full physics lab library and calculator index are open too.

Frequently asked questions

What does relative velocity actually mean?

It is the velocity one body has as measured by another, rather than as measured by the ground. Sit in B, treat yourself as stationary, and v_AB is the velocity you would say A has. Nothing physical changes when you move your point of view: both bodies carry on exactly as before, and only the numbers you would write down change.

Which way round does v_AB read?

On this page v_AB = v_A - v_B means the velocity of A as measured by B, so the first subscript is the body being watched and the second is the observer. Textbooks genuinely disagree about which subscript comes first, so it is always worth checking which convention a source uses before trusting a sign. Swapping them gives v_BA, which has exactly the same magnitude and the opposite direction, and the reverse view chip prints it beside every answer.

Why do head-on speeds add while same-direction speeds subtract?

Because the sign of the second velocity is the only thing that changes, and it is being subtracted. Two cars at 100 and 80 km/h the same way give 100 - 80 = 20 km/h; turn the second one round and its velocity becomes -80, so 100 - (-80) = 180 km/h. The whole difference between 20 and 180 km/h is twice the 80, which is why a head-on relative speed is larger than either speed on its own.

Is the relative speed just the difference of the two speeds?

No, and this is the commonest mistake on the topic. Subtracting the two speeds only gives the relative speed when the two motions are collinear and in the same sense, which is the one case most people picture. Press Rain and cyclist here: the relative speed is 10 m/s while the difference of the two speeds is 2.000 m/s, and the last chip says so in words on every state.

Is relative speed the same as closing speed?

No, and this page deliberately does not compute closing speed. Closing speed is the part of the relative velocity that points along the line joining the two bodies, so it depends on where they are and not only on how they are moving. Two aircraft flying north on parallel tracks 1000 m apart, at 200 and 150 m/s, have a relative speed of 50 m/s while the gap between them changes at 0 m/s in that instant - this page has no position boxes, so it gives you the 50 and leaves the gap alone.

Why does the relative direction show a dash?

Because the relative speed is exactly zero, and a zero vector has no direction. The two bodies have the same velocity, so neither sees the other move at all, and the honest readout is nothing rather than a bearing. The arctangent of zero over zero returns zero in every programming language, so computing it anyway would print a confident due north.

When does subtracting velocities stop working?

When the speeds get close to the speed of light, which is about 300,000 km/s. At traffic speeds the Galilean answer is not approximately right but right to fourteen digits, so this page uses it for cars and trains without apology. Two spacecraft approaching head-on at 0.800c would give 1.600c by subtraction, which is not a velocity at all; the correct composition gives 0.9756c, and subtraction only breaks the four-figure precision of this page once each body is past roughly 0.007c, around 2,120 km/s.

Can I use it for a river crossing or an aircraft in wind?

Yes, for the velocity part, and the worked table does both. A boat crossing a 3.00 m/s current at 4.00 m/s and an aircraft in a 60.0 km/h crosswind are both two velocities in one frame, and this page prints 5 m/s for the boat as the water sees it and 257.1 km/h for the aircraft as the ground does. What it will not give you is a crossing time, a drift distance or a heading correction, because those need the width of the river and an inverse sine that this page has no box for.

References & formula source

  • The relation this page solves is the Galilean transformation, written componentwise: v_AB = v_A - v_B, where both velocities are measured in one common frame. On this page that frame is called the ground frame, the two components are east and north, and the relative speed is sqrt(east x east + north x north). Nothing here is quoted: every figure in the prose and in the worked table is a string this page printed for the inputs named beside it.
  • The convention this page uses is that v_AB = v_A - v_B reads "the velocity of A as measured by B", so the first subscript is the body being watched and the second is the observer. Textbooks genuinely disagree about which subscript comes first, so the reading is stated in the formula band, in both field labels, in the note under the widget, in the working and in the symbol table rather than being left implicit. The reverse view, v_BA, has the same magnitude and the opposite direction, which an independent reference script checks for arbitrary inputs.
  • Bearings on this page run clockwise from north, so east = speed x sin(bearing) and north = speed x cos(bearing). That is not the convention of the vector addition calculator, which measures its angles anticlockwise from the positive x-axis and so exchanges the sine for the cosine. Either is correct and the two are not interchangeable, which is why this page states which one it uses in six places.
  • Every answer stops at four significant figures with the trailing zeros kept, so a drift angle reads 13.50 degrees rather than 13.5. That is a choice rather than a limit of the data: every input here is an exact value a reader typed, so the precision is set by the ceiling alone and no source can be appealed to for a fifth digit. The engine headline drops a trailing zero where the chips keep it, which is why the same answer can read 5.56 above and 5.560 beside it.
  • The relative speed equals the plain difference of the two speeds only when the two motions are collinear and in the same sense. The difference-of-speeds chip prints both figures and compares them, so the claim it makes is the one the two strings beside it support and never a tolerance of its own. On the Rain and cyclist state the relative speed is 10 m/s against a difference of speeds of 2.000 m/s.
  • Closing speed is not computed here, and it is not the same quantity. It is the projection of the relative velocity on the line joining the two bodies, so it needs their positions as well as their velocities: two aircraft flying north on parallel tracks 1000 m apart at 200 and 150 m/s have a relative speed of 50 m/s while their separation changes at 0 m/s at the instant they are abreast. This page has no position boxes, so it returns the relative speed and says nothing about the gap.
  • The Galilean rule this page uses is the low-speed limit of relativistic velocity composition. For two vehicles meeting head-on at 100 and 80 km/h the relativistic correction is a fractional 6.868e-15, the product of the two speeds divided by c squared, which is ten decades below the four figures printed here, so the subtraction is used for traffic without apology. Reaching the same comparison by subtracting one composition from the other returns 6.821e-15 for that pair instead, which is that correction with its last digits lost to the cancellation rather than a second value of it. Two craft at 0.800c head-on would give 1.600c by subtraction, which is impossible; the correct answer is 0.9756c, and the four-figure ceiling of this page survives until each body passes roughly 0.007c. The theory behind that is not derived here.
  • Halliday, Resnick and Walker, Fundamentals of Physics, chapter 4 (relative motion in one and two dimensions); Young and Freedman, University Physics, chapter 3.5. Cited as background reading for the transformation and the subscript convention. Verify before use: these are textbook references rather than links, and no page or edition number is claimed.
  • Wikipedia, "Relative velocity", is the general-reference article on this topic; the cluster specification records it as fetched and returning HTTP 200 at stage 1 of this build. It is background reading and not the source of any figure here. Verify before use.
  • This page computes no closing speed, no separation, no river crossing time, no downstream drift, no heading correction, no acceleration and no relativistic composition, and none of those is an oversight: each needs a position, a width or an inverse sine that this page has no box for. Every figure quoted in the prose and the tables above is a string this calculator printed for the inputs named beside it, or a ratio checked against an independent reference written before this page existed and sharing no code with it. Where a cell and the running widget ever part company, believe the widget.

Embed this calculator

Add this free Relative Velocity calculator to your own website — copy the snippet below.