Home›Study Resources›Maths›
How do you calculate the angle between two vectors?
Maths
Higher

How do you calculate the angle between two vectors?

To calculate the angle between two vectors, use the scalar product. Find a·b by multiplying matching components and adding the results. Find the magnitude of each vector. Then use cos θ = a·b ÷ (|a| × |b|) and take the inverse cosine. Example: Find the angle between a = (1, 2, 2) and b = (2, −1, 2). a·b = (1)(2) + (2)(−1) + (2)(2) = 4 |a| = √(1 + 4 + 4) = 3 and |b| = √(4 + 1 + 4) = 3 cos θ = 4 ÷ (3 × 3) = 4/9 Answer: θ = 63.6° (1 d.p.)

Quick answer: To calculate the angle between two vectors, find the scalar product a·b by multiplying matching components and adding the results. Find the magnitude of each vector. Then use cos θ = a·b ÷ (|a||b|) and take the inverse cosine. The angle is between 0° and 180°.

What the specification expects

The SQA Higher Mathematics course specification lists evaluating a scalar product given suitable information and determining the angle between two vectors. Both vectors must be treated tail to tail, that is pointing away from the same point.

The method

  1. Work out a·b = a1b1 + a2b2 + a3b3.
  2. Work out |a| = √(a12 + a22 + a32) and |b| in the same way.
  3. Substitute into cos θ = a·b ÷ (|a||b|).
  4. Use the inverse cosine, with the calculator in degrees.

Worked example 1: two vectors

Find the angle between a = (1, 2, 2) and b = (2, −1, 2).

  1. a·b = (1)(2) + (2)(−1) + (2)(2) = 2 − 2 + 4 = 4.
  2. |a| = √(1 + 4 + 4) = 3 and |b| = √(4 + 1 + 4) = 3.
  3. cos θ = 4 ÷ (3 × 3) = 4/9.
  4. θ = cos−1(4/9).

Answer: θ = 63.6° (1 d.p.)

Worked example 2: an obtuse angle

Find the angle between p = (1, 0, −1) and q = (−2, 1, 1).

  1. p·q = (1)(−2) + (0)(1) + (−1)(1) = −3.
  2. |p| = √2 and |q| = √6, so |p||q| = √12.
  3. cos θ = −3 ÷ √12 = −0.866…

Answer: θ = 150° (a negative scalar product means an obtuse angle)

Worked example 3: an angle in a triangle

A(1, 2, 3), B(3, 3, 5) and C(2, 1, 5) are the vertices of a triangle. Calculate angle ABC.

  1. Both vectors must start at B: BA = (−2, −1, −2) and BC = (−1, −2, 0).
  2. BA·BC = (−2)(−1) + (−1)(−2) + (−2)(0) = 2 + 2 + 0 = 4.
  3. |BA| = √(4 + 1 + 4) = 3 and |BC| = √(1 + 4 + 0) = √5.
  4. cos θ = 4 ÷ (3√5) = 0.596…

Answer: Angle ABC = 53.4° (1 d.p.)

Common mistakes

  • Using vectors that do not start at the same point. For angle ABC, use BA and BC, not AB and BC.
  • Forgetting to square root when finding a magnitude.
  • Rearranging the formula wrongly. It is cos θ = a·b ÷ (|a||b|).
  • Having the calculator in radians instead of degrees.

FAQs

What does a negative scalar product tell me?

The angle is obtuse, between 90° and 180°. A scalar product of 0 means the vectors are perpendicular.

Can I use this in two dimensions?

Yes. Use the same formula with two components instead of three.

Want one-to-one help? Find an online Maths tutor with ExpertTutor.

Reviewed by

Want one-to-one support?

One-to-one online tuition can help you build confidence in your subject. Find a tutor who teaches your course.

Find a Tutor

Learn face to face in Glasgow

Prefer in-person lessons? Visit the ExpertTutor Glasgow Southside centre.

See the centre