Angle Between Two Vectors Calculator
This angle between two vectors calculator gives the answer in degrees and radians together, keeps the cosine as an exact surd, and never returns an error for the case that trips most other tools.
Type <1, 0> . <1, 1> and you get exactly 45° — not 45.0000, which leaves you guessing whether it really is 45.
One Formula, and Everything Else Is Filling It In
cos θ = (a · b) ÷ (|a| |b|)
One line, and it is the whole method. It comes from the other way of writing a dot product — a · b = |a| |b| cos θ — with the angle moved to one side.
Above the line: the matching components multiplied and added. Below it: each vector's own length, from Pythagoras. Divide, take the inverse cosine, done.
The Sign Tells You the Answer Before You Have It
A length is never negative, so whatever sign the fraction carries came from the top of it — and that one fact tells you a great deal before any arithmetic.
Positive and the angle is under 90°. Negative and it is over. Zero and it is a right angle exactly. You can say which of those you are heading for by glancing at one number, which is a useful check on whatever your calculator eventually shows.
Why Parallel Vectors Break Other Calculators
Take ⟨1, 2, 3⟩ and ⟨2, 4, 6⟩. Same direction, one twice as long. The angle is obviously 0°.
Work it out in ordinary decimals and the fraction comes to 1.0000000000000002. An inverse cosine cannot take anything above 1, so the page returns NaN, or an error, or nothing at all — for a question a child could answer by looking at it.
That is not a rare edge. Put twenty thousand pairs of parallel vectors with whole-number components through the decimal route and 3,706 of them fail. Nearly one in five.
This page compares (a · b)² against (a · a)(b · b) in whole numbers before it goes anywhere near an inverse cosine. Mathematics guarantees the first is never the larger; doing the comparison exactly is what carries that guarantee into the code.
| The two vectors | cos θ | The angle |
|---|---|---|
| along the same line, together | 1 | 0° |
| leaning the same way | between 0 and 1 | under 90° |
| at right angles | 0 | 90° |
| leaning apart | between −1 and 0 | over 90° |
| along the same line, opposed | −1 | 180° |
Where Anyone Actually Needs This Angle
Rarely for its own sake. Almost always as a step towards something else.
A force pushing a crate along a floor at some angle to the motion does work equal to the force times the distance times the cosine of that angle. So the angle is what decides how much of the push is useful and how much is wasted pressing down into the floor.
Computer graphics leans on the same quantity constantly. How brightly a surface is lit depends on the angle between the light and the surface, and that runs millions of times a second inside any game you have played. It is done on unit vectors, because when both lengths are already 1 the division disappears and the cosine is simply the product itself — which is exactly why graphics code normalises everything first.
Navigation, structural engineering, the similarity between two documents in a search engine, the shortest route between two bearings on a chart. Same fraction, different clothes.
Always Between 0° and 180°
An inverse cosine returns nothing outside that range, and it is the right range to have.
Two arrows can point together, at right angles, or in opposite directions, . Widest apart they can ever be is a straight line. So there is no negative angle between vectors and no 250°. If your working produced one, a sign went astray earlier.
Order makes no difference either. The top of the fraction is the same whichever vector you write first, and the bottom obviously is, so the angle is too.
Vectors, or the Lines They Lie On?
Worth knowing, because questions ask for both and mean different things.
⟨1, 0⟩ and ⟨−1, 1⟩ are 135° apart as vectors. But the two lines they lie along cross at 45°, because a line has no arrowhead and does not care which way you travel down it.
Whenever the vector answer is obtuse, this page prints the acute figure underneath it. Which one the question wants is usually clear from whether it says "vectors" or "lines".
Radians Are Not a Different Answer
45° and 0.785398 are the same angle written two ways, and a calculator left in the wrong mode is the commonest reason a correct method produces a wrong-looking number.
Degrees for geometry questions, radians almost everywhere in calculus and physics. Both appear here side by side so there is nothing to convert and nothing to switch.
How to Use This Angle Between Two Vectors Calculator
Two vectors, each inside its own brackets: <3, 4> . <1, 2>. Whether you put a dot between them makes no difference. Three components work as readily as two, and a fraction typed in comes back out as a fraction.
Results come back in both units, the cosine left as a root wherever that is possible, and what kind of angle it is. Show the working opens the fraction built up piece by piece: the top from the components, the bottom from the two lengths, and the inequality that makes the answer safe.
The top of that fraction is worked through in detail on the dot product page, and the two lengths on the magnitude and direction page. If the pair came out of a question that first asked you to combine them, that step is vector addition. Nothing is printed until several checks have passed, including that the cosine squared matches the exact ratio it should and that the result really lies between 0° and 180°.
Angle Between Two Vectors Calculator FAQ
How do you find the angle between two vectors?
What is the formula for the angle between two vectors?
Can the angle between two vectors be more than 180 degrees?
Why does my calculator give an error for parallel vectors?
What is the angle between two perpendicular vectors?
Is the angle the same whichever vector you name first?
How do you find the angle between two 3D vectors?
What is the difference between the angle between two vectors and between two lines?
Divide, take the inverse cosine, and check the answer landed between 0° and 180°.