Angle Between Two Vectors Calculator - Find the Angle

Vector dimension

Vector u

Fractions like 3/4 and decimals both work.

Vector v

Use a leading − for negative components.

Angle θ between u and v

45° exactly

Acute angle (between 0° and 90°)θ = π/4 rad

Radians

0.7854

cos θ

√2/2

u · v

5

‖u‖

2.2361

‖v‖

3.1623

Supplement 180° − θ

135°

Signed angle u → v (counterclockwise positive)

45°

Both vectors drawn from the origin

uv45°

Solution, step by step

  1. Dot product: u · v = (2)(1) + (1)(3) = 5
  2. Magnitude of u: ‖u‖ = √(2² + 1²) = √52.2361
  3. Magnitude of v: ‖v‖ = √(1² + 3²) = √103.1623
  4. Cosine: cos θ = 5 / (2.2361 × 3.1623) = 0.7071 = √2/2
  5. Inverse cosine: θ = arccos(0.7071) = 45° = π/4 rad0.7854 rad

How to Use This Calculator

  1. Pick 2D or 3D with the "Vector dimension" toggle — 3D adds a z component to each vector.
  2. Type the components of vector u into the u₁ and u₂ (and u₃) fields. Fractions like 3/4 work.
  3. Do the same for vector v in the blue panel.
  4. Read the angle θ in degrees at the top, with radians, cos θ, the dot product, and both magnitudes in the grid below it.
  5. Check the "Solution, step by step" box to copy the full working into homework, and use the preset buttons to load known angles like 45° or 90°.

Share this calculator

Help others solve their calculations

Found this calculator helpful? Share it with your friends, students, or colleagues who might need it!

How an Angle Between Two Vectors Calculator Turns a Dot Product into Degrees

About the Author

Marko Šinko - Co-Founder & Lead Developer

Marko Šinko

Co-Founder & Lead Developer, AI Math Calculator

Lepoglava, Croatia
Advanced Algorithm Expert

Croatian developer with a Computer Science degree from University of Zagreb and expertise in advanced algorithms. Co-founder of award-winning projects, ensuring precise mathematical computations and reliable calculator tools.

📅 Published:
Angle between two vectors calculator diagram with two arrows from one origin and an emerald arc marking the angle theta between them

An angle between two vectors calculator settles a question that shows up everywhere from physics homework to search engines: given two directions, how far apart do they point? Feed it the components of u and v — in 2D or 3D — and it returns the angle in degrees and radians, flags exact answers when they exist (45°, not 44.999998°), and shows every intermediate number: the dot product, both magnitudes, and the cosine.

The whole computation hangs on one identity, cos θ = (u · v) / (‖u‖‖v‖), and this article works through the questions people actually ask about it. Where does that formula come from? What does the sign of the dot product tell you before you compute anything else? Which cosine values are worth memorizing? And what should you reach for instead when floating-point arithmetic hands you cos θ = 1.0000000002?

The 30-Second Version

Three steps, always the same. First compute the dot product u · v by multiplying matching components and adding. Then compute each vector magnitude. Finally divide and take the inverse cosine:

θ = arccos( (u · v) / (‖u‖ ‖v‖) )

Take u = ⟨3, 4⟩ and v = ⟨5, 12⟩. The dot product is (3)(5) + (4)(12) = 63. The magnitudes are √(9 + 16) = 5 and √(25 + 144) = 13 — both Pythagorean pairs, so they come out whole. That gives cos θ = 63/65 ≈ 0.9692, and arccos(0.9692) ≈ 14.25°. The answer always lands between 0° and 180°: the formula measures separation between directions, never a rotation past a straight line.

Why Does the Dot Product Know About Angles?

Because the formula is the law of cosines wearing vector notation. Draw u and v from the same point and connect their tips; the third side of that triangle is the vector u − v. The law of cosines says ‖u − v‖² = ‖u‖² + ‖v‖² − 2‖u‖‖v‖cos θ. Now expand ‖u − v‖² component by component instead: it equals ‖u‖² − 2(u · v) + ‖v‖². Set the two expansions equal, cancel the squared magnitudes on both sides, divide by −2, and you're left with u · v = ‖u‖‖v‖cos θ. That's the entire derivation — two lines, no trigonometric identities beyond the one Euclid already knew.

It checks out numerically, too. With the same u = ⟨3, 4⟩ and v = ⟨5, 12⟩ from above, u − v = ⟨−2, −8⟩, so ‖u − v‖² = 4 + 64 = 68. The law of cosines side gives 25 + 169 − 2(5)(13)(63/65) = 194 − 126 = 68. Same number from two unrelated-looking routes — which is exactly why the dot product deserves its reputation as compressed geometry.

What an Angle Between Two Vectors Calculator Reads From the Sign Alone

Here's a shortcut worth internalizing: you can classify the angle before touching a single square root. Magnitudes are always positive, so the sign of cos θ — and therefore the type of angle — is decided entirely by the dot product:

  • u · v > 0 → acute angle (less than 90°)
  • u · v = 0 → exactly 90°; the vectors are orthogonal
  • u · v < 0 → obtuse angle (more than 90°)

So for ⟨1, 2⟩ and ⟨−2, 1⟩, the dot product is −2 + 2 = 0 and you can write "90°" with no arccos at all. A full 3D run is barely longer. Take u = ⟨1, 2, 2⟩ and v = ⟨2, 3, 6⟩: u · v = 2 + 6 + 12 = 20, ‖u‖ = √9 = 3, ‖v‖ = √49 = 7, so cos θ = 20/21 ≈ 0.9524 and θ ≈ 17.75°. (Those magnitudes came out whole because ⟨1, 2, 2⟩ and ⟨2, 3, 6⟩ are Pythagorean quadruples — the 3D cousins of the 3-4-5 triangle.)

One subtlety the sign rule exposes: vectors have direction, lines don't. The angle between the vectors ⟨1, 0⟩ and ⟨−1, 0.01⟩ is about 179.4°, but the angle between the lines they sit on is only 0.6°. If your problem asks for the acute angle between two lines, take the absolute value of cos θ before applying arccos — that folds every answer into the 0°–90° range.

Nine Cosines That Cover Almost Every Homework Problem

Textbook problems are rigged so cos θ lands on a clean value. Recognize these nine and you can often skip the arccos button entirely — the calculator above does the same check and reports the exact angle whenever cos θ matches one of them:

cos θθ in degreesθ in radiansGeometric meaning
10Same direction (parallel)
√3/2 ≈ 0.86630°π/6Narrow separation
√2/2 ≈ 0.70745°π/4Half of a right angle
1/260°π/3Equilateral-triangle angle
090°π/2Orthogonal
−1/2120°2π/3Obtuse mirror of 60°
−√2/2 ≈ −0.707135°3π/4Obtuse mirror of 45°
−√3/2 ≈ −0.866150°5π/6Obtuse mirror of 30°
−1180°πOpposite directions (antiparallel)

A worked match: u = ⟨2, 1⟩ and v = ⟨1, 3⟩ give u · v = 5, ‖u‖ = √5, ‖v‖ = √10, so cos θ = 5/√50 = 5/(5√2) = 1/√2 = √2/2. Row three of the table says θ = 45° exactly — no decimal approximation required.

Where the Angle Shows Up Once You Leave the Classroom

Search and recommendation engines run this formula billions of times a day under the name cosine similarity. Documents and user profiles become high-dimensional vectors, and cos θ measures how aligned two of them are: 0.98 means near-duplicates, values near 0 mean unrelated. Engineers usually stop at the cosine and never convert to degrees — the ordering is the same and arccos costs extra cycles.

Physics grades the angle harshly. Work is W = ‖F‖‖d‖cos θ. Drag a sled 8 m with a 50 N pull and the rope at 60° to the ground, and you bank W = 50 × 8 × 0.5 = 200 J. Pull level instead (θ = 0°, cos θ = 1) and the same effort delivers 400 J. The angle silently threw away half your work. The vector projection ‖F‖cos θ is precisely the part of the force that pulled its weight.

3D graphics lights every pixel with it. Lambert's law shades a surface in proportion to the cosine of the angle between the surface normal and the light direction. A face turned 60° from the light renders at half brightness; past 90°, cos θ goes negative and the renderer clamps it to black. Game engines first normalize both vectors to unit length so the dot product is the cosine — dividing by ‖u‖‖v‖ becomes dividing by 1.

arccos, atan2, or the Cross Product — Which Route Should You Take?

The arccos formula is the one every textbook prints, but it has two sharp edges. First, it can crash on parallel vectors: rounding error happily produces cos θ = 1.0000000002, and arccos of anything past 1 is undefined — a plain domain error in most languages. Any serious implementation (including the calculator above) clamps the cosine into [−1, 1] first. Second, arccos is numerically flat near 0° and 180°, where a change of 0.0000001 in the cosine moves the angle by a whole degree's worth of precision. When tiny angles matter — think spacecraft attitude or camera alignment — the stable alternative is θ = atan2(‖u × v‖, u · v), which stays accurate across the entire range because the cross product supplies the sine while the dot product supplies the cosine.

MethodReturnsReach for it when
arccos(u·v / ‖u‖‖v‖)Unsigned 0° to 180°Homework and hand calculation; matches every textbook
atan2(‖u×v‖, u·v)Unsigned 0° to 180°Code where vectors can be nearly parallel; no clamping needed
atan2(u×v, u·v) in 2DSigned −180° to 180°Steering and rotation: the sign says turn left or turn right

That signed 2D variant deserves a sentence more. A robot facing along u that wants to face along v doesn't just need the 25° separation — it needs to know whether to rotate clockwise or counterclockwise. The scalar cross product u₁v₂ − u₂v₁ carries that orientation in its sign, which is why the calculator reports a signed angle in 2D mode. And one boundary case applies to every method equally: the zero vector has no direction, so the angle between ⟨0, 0⟩ and anything is undefined — not 0°, not 90°. If a vector computation upstream can output ⟨0, 0⟩, handle that case before asking for an angle.

Frequently Asked Questions

Still Have Questions?

The detailed content on this page provides comprehensive explanations and examples to help you understand better.