Skip to content
LoveToCalc

Theorem — what does that mean?

Angle between two vectors

Divide the dot product by the two lengths, and the angle is the one whose cosine that gives.

In Swedish: Vinkeln mellan två vektorer

Angle between two vectors

The relation

cos(θ)=a·b|a||b|

The cosine of the angle is the dot product divided by the two lengths multiplied together. A negative dot product means an obtuse angle.

Two vectors drawn as arrows from the same point, with lengths |a| and |b|, and the angle θ between them marked at the point where they start.
Solve for
Solved for θ

θ=arccos(a·b|a||b|)

Show how the formula is rearranged
  1. cos(θ)=a·b|a||b|
  2. Take arccos of both sides, which undoes the arccos and leaves the angle on its own.

    θ=arccos(a·b|a||b|)

θ≈73.7398

θ equals the arccosine of ((14 divided by (10 times 5))), equals the arccosine of ((14 divided by 50)), equals the arccosine of (0.28), is approximately 73.7398 degrees

Working4 steps

Practice questions

You are given

  • a·b=63
  • |a|=5
  • |b|=13

Round to 1 decimal.

The formula

Holds when both vectors have a length greater than 0. A zero vector points nowhere and makes no angle with anything.

The working takes three steps. With a = (6, 8) and b = (−3, 4):

  1. The dot product. a · b = 6 · (−3) + 8 · 4 = −18 + 32 = 14, with the dot product.
  2. The lengths. |a| = √(36 + 64) = 10 and |b| = √(9 + 16) = 5, with the magnitude of a vector.
  3. The angle. cos θ = 14 / (10 · 5) = 0.28, so θ = cos⁻¹ 0.28 ≈ 73.7°.

The card above takes over at step 3: type in the dot product and the two lengths.

A negative dot product means an obtuse angle

With a = (8, 15) and b = (3, −4) the dot product is 24 − 60 = −36. The lengths are 17 and 5, so

cos θ = −36 / 85 ≈ −0.424

Working θ
cos⁻¹(−0.424) 115.1°
cos⁻¹(0.424), minus sign dropped 64.9°

Both answers look like angles. But a negative dot product means the vectors point more away from each other than towards each other, and the angle between them is then more than 90°. Keep the sign all the way into the inverse cosine. The angle between two vectors lies between 0° and 180°, and cos⁻¹ returns an answer in exactly that range.

When the dot product is 0

a = (3, 4) and b = (−4, 3) give a · b = −12 + 12 = 0, so cos θ = 0 and θ = 90°. The vectors are perpendicular, however long they are. To check only whether two vectors are perpendicular, the dot product on its own is enough.

Why the formula holds

Place a and b so they start at the same point. The segment between their tips is a − b, and the three form a triangle with the angle θ between a and b. The law of cosines gives

|a − b|² = |a|² + |b|² − 2 · |a| · |b| · cos θ

Written out in components, the left side is |a|² + |b|² − 2(a₁b₁ + a₂b₂). The two expressions are equal, so |a| · |b| · cos θ = a₁b₁ + a₂b₂, which is the formula.

Common mistakes

Common questions

Does it work for vectors in three dimensions? Yes. The dot product gains a third term, a₃b₃, and each length a third square under the root. The formula for cos θ is the same.

Which angle do I get, the acute or the obtuse one? The one between the vectors as they point, between 0° and 180°. For the angle between two lines, which have no direction, take the acute one: 180° minus an obtuse angle.

Can cos θ come out larger than 1? Not for real vectors: the size of the dot product is at most |a| · |b|. A number outside −1 to 1 means something went wrong, for example a length without its root.

Looking for another letter? The formula solved for each one
Solved for each letter
Solve forRearrangedWith the numbersComes to
a·b|a||b| cos(θ)10·5 cos(73.74°)14
|a|a·b|b| cos(θ)145 cos(73.74°)10
|b|a·b|a| cos(θ)1410 cos(73.74°)5
θarccos(a·b|a||b|)arccos(1410·5)73.74

Last reviewed October 7, 2026 ·How pages are reviewed

GeometryAll formulas

Put this formula on your site

Copy the code into your page where the formula card should appear. It loads from lovetocalc.com, so it stays current on its own — all we ask is that the credit line comes with it.