Grade by Grade
C. Geometry and Algebra of Vectors · Dot and Cross Products

Angles Between Vectors and Direction Angles

C2.4 C2.8About 65 minutes
Learning goals
  • I can find the angle between two vectors in two-space or three-space using the dot product.
  • I can find the angles of a triangle, and check for right angles, when its vertices are given as points.
  • I can find the direction cosines and direction angles of a vector in three-space.

Words to know

angle between vectors
θ = cos⁻¹((u · v)/(|u||v|)), always between 0° and 180°.
direction angles
The angles α, β and γ that a vector makes with the positive x-, y- and z-axes.
direction cosines
cos α, cos β and cos γ: the components of a vector divided by its magnitude.
body diagonal
A segment joining opposite corners of a box, passing through its interior.

Angles from components

How steep is the diagonal of a cube compared with one of its edges? What angle does the line from a room's corner to the opposite ceiling corner make with the floor? In three-space you cannot just lay a protractor on the picture. But you can compute the angle exactly with the dot product.

Put the two formulas for u · v side by side: |u||v| cos θ = u₁v₁ + u₂v₂ + u₃v₃. Divide both sides by |u||v|:

cos θ = (u · v) / (|u||v|)

Then θ = cos⁻¹ of that number. Because θ is always between 0° and 180°, and cos⁻¹ gives exactly one angle in that range, there is never a second answer to look for.

Four steps to an angle

  1. Compute u · v.
  2. Compute |u| and |v|.
  3. Divide to get cos θ. Keep it exact (or keep all the calculator digits) until the end.
  4. Take cos⁻¹ in degree mode.

If cos θ comes out bigger than 1 or smaller than −1, you have made an arithmetic error.

Worked example

Example 1: Two-space

Find the angle between u = [2, 3] and v = [5, −1].

  1. u · v = 10 − 3 = 7.
  2. |u| = √(4 + 9) = √13 and |v| = √(25 + 1) = √26.
  3. cos θ = 7/(√13 √26) = 7/√338 ≈ 0.3807.
  4. θ = cos⁻¹(0.3807...) ≈ 67.6°.

θ ≈ 67.6°

Worked example

Example 2: Three-space, obtuse

Find the angle between a = [1, −2, 2] and b = [3, 0, −4].

  1. a · b = 3 + 0 − 8 = −5.
  2. |a| = √(1 + 4 + 4) = 3 and |b| = √(9 + 0 + 16) = 5.
  3. cos θ = −5/15 = −1/3.
  4. θ = cos⁻¹(−1/3) ≈ 109.5°.

θ ≈ 109.5°. The negative dot product warned you it would be obtuse.

edOθd = [1, 1, 1], e = [0, 1, 0]cos θ = (d · e) / (|d||e|)= 1 / (√3 × 1)θ ≈ 54.7°
In a unit cube, the body diagonal d from O to the far corner makes an angle of about 54.7° with the edge e along the y-axis. (Angles look distorted in a flat drawing of a solid, which is why we calculate them.) The dashed edges are hidden at the back of the cube.
Worked example

Example 3: Diagonal of a cube

Find the angle between a body diagonal of a cube and one of its edges.

  1. Place the cube with edges of length 1 along the axes and a corner at O. The edge along the y-axis is e = [0, 1, 0]; the body diagonal is d = [1, 1, 1].
  2. d · e = 1, |d| = √3, |e| = 1.
  3. cos θ = 1/√3, so θ = cos⁻¹(1/√3) ≈ 54.7°.

θ ≈ 54.7° for a cube of any size (scaling both vectors does not change the angle).

Worked example

Example 4: Angles of a triangle in three-space

Find the angles of the triangle with vertices A(1, 0, 2), B(3, 4, 1) and C(0, 2, 5).

  1. At A, use the two vectors leaving A: AB = [2, 4, −1] and AC = [−1, 2, 3].
  2. AB · AC = −2 + 8 − 3 = 3; |AB| = √21, |AC| = √14. cos A = 3/√294 ≈ 0.1750, so ∠A ≈ 79.9°.
  3. At B, use BA = [−2, −4, 1] and BC = [−3, −2, 4]: BA · BC = 6 + 8 + 4 = 18; |BA| = √21, |BC| = √29. cos B = 18/√609 ≈ 0.7294, so ∠B ≈ 43.2°.
  4. ∠C ≈ 180° − 79.9° − 43.2° = 56.9°. (Check with CA = [1, −2, −3] and CB = [3, 2, −4]: CA · CB = 3 − 4 + 12 = 11, cos C = 11/(√14 √29) ≈ 0.5459, ∠C ≈ 56.9° ✓.)

∠A ≈ 79.9°, ∠B ≈ 43.2°, ∠C ≈ 56.9°

Vectors must leave the vertex

To find the angle of a triangle at a vertex, both vectors must start at that vertex (tail to tail). Using AB and BC at B gives the exterior angle 180° − ∠B instead.

Worked example

Example 5: Is it a right triangle?

Show that P(2, 1), Q(5, 5) and R(9, 2) form a right triangle.

  1. Test the angle at Q with vectors leaving Q: QP = [−3, −4] and QR = [4, −3].
  2. QP · QR = −12 + 12 = 0.

The dot product is 0, so ∠Q = 90° and △PQR is a right triangle. (Bonus: |QP| = |QR| = 5, so it is also isosceles.)

Direction angles and direction cosines

A vector in three-space makes an angle with each positive axis. These are its direction angles: α (alpha) with the x-axis, β (beta) with the y-axis and γ (gamma) with the z-axis.

Dot v = [v₁, v₂, v₃] with i = [1, 0, 0]: v · i = v₁ and |i| = 1, so cos α = v₁/|v|. In the same way, cos β = v₂/|v| and cos γ = v₃/|v|. These three numbers are the direction cosines of v. They are exactly the components of the unit vector v/|v|, so

cos²α + cos²β + cos²γ = 1.

xyzvγβcos α = v₁ / |v|cos β = v₂ / |v|cos γ = v₃ / |v|cos²α + cos²β + cos²γ = 1α is measured from the x-axis
The direction angles α, β and γ are the angles that v makes with the positive x-, y- and z-axes. The drawing marks β and γ; α is measured the same way from the x-axis. Their cosines, the direction cosines, are the components of v divided by |v|.
Worked example

Example 6: Direction angles

Find the direction angles of v = [2, −1, 2].

  1. |v| = √(4 + 1 + 4) = 3.
  2. cos α = 2/3, so α ≈ 48.2°.
  3. cos β = −1/3, so β ≈ 109.5°. (The y-component is negative, so v leans away from the positive y-axis.)
  4. cos γ = 2/3, so γ ≈ 48.2°.
  5. Check: (2/3)² + (−1/3)² + (2/3)² = 4/9 + 1/9 + 4/9 = 1. ✓

α ≈ 48.2°, β ≈ 109.5°, γ ≈ 48.2°

Just for fun

Why did the obtuse angle go to the beach in July?

Because it was over 90 degrees. (Example 2's angle, at 109.5°, would agree.)

Hands-on activity

Measure a diagonal in a box

You need: a cardboard box with an open top or a removable lid (a shoebox works well), a ruler or tape measure, a piece of string, tape, a protractor and a calculator.

  1. Choose one bottom corner of the box as the origin O. Measure the box's length a (x-direction), width b (y-direction) and height c (z-direction) in centimetres.
  2. Tape one end of the string at O and stretch it straight through the inside of the open box to the diagonally opposite top corner, and tape it there. This is the body diagonal d = [a, b, c].
  3. Compute the direction angles of d from cos α = a/|d|, cos β = b/|d|, cos γ = c/|d|.
  4. Hold the protractor's centre at O, in the plane that contains the string and the x-edge, and measure the angle between them. Compare with α.
  5. Repeat for the angle between the string and the vertical edge (γ).

What to look for: a 40 cm × 30 cm × 20 cm box has |d| ≈ 53.9 cm, α ≈ 42.0°, β ≈ 56.1° and γ ≈ 68.2°. Measuring in three dimensions is hard, so within about 3° is a good result. That is exactly why the dot product is so useful.

Your turn

1

Find the angle between [3, 4] and [5, 12].

2

Find the angle between [1, 2] and [−3, 1].

3

Find the angle between [2, −1, 1] and [1, 1, 2].

4

Find the angle between [1, 0, −1] and [0, 1, 1].

5

Find the angle between [4, −3, 0] and k.

6

Find the direction angles of [3, −4, 12].

7

Find the angle between a body diagonal of a cube and a diagonal of a face, both starting at the same corner.

More practice: warm-up

1

Write the formula for cos θ in terms of u and v.

2

u · v = 0 for non-zero vectors. What is θ?

3

Find the angle between [1, 1] and [1, 0].

4

Find the angle between [2, 0, 0] and [−5, 0, 0].

5

Can cos θ = 1.2 when you compute the angle between two vectors?

More practice: on your own

1

Find ∠K in the triangle K(1, 1, 0), L(2, 3, 1), M(0, 2, 3).

2

Find the direction cosines and direction angles of [2, 2, −1].

3

A vector has α = 60° and β = 45°, and γ is acute. Find γ and the unit vector in this direction.

4

Do O(0, 0, 0), A(1, 2, 2) and B(2, −2, 1) form a right triangle?

5

Find the angle between [−2, 5] and [3, 1].

Challenge

1

Prove that cos²α + cos²β + cos²γ = 1 for any non-zero vector v.

2

Find the acute angle between two body diagonals of a cube.

3

Find k so that the angle between [k, 1, 1] and [1, 1, 0] is 60°.

Check your understanding

Quiz

1.

What is the angle between [2, 0] and [1, 1]?

2.

What is the angle between [1, 2, 2] and [0, 3, 4], to the nearest tenth of a degree?

3.

What is cos β (the direction cosine for the y-axis) of v = [2, −3, 6]?

4.

For any non-zero vector, what is cos²α + cos²β + cos²γ?

5.

To find ∠B in △ABC with vectors, which pair should you use?

6.

About what angle does a body diagonal of a cube make with an edge that starts at the same corner?

For parents and teachers

Big idea (C2.4): the angle between two vectors comes from cos θ = (u · v)/(|u||v|). Direction angles are the angles a vector makes with the three axes; their cosines are the components of the unit vector, so their squares add to 1.

How to help: Ask your teen to find the angle between two easy vectors (like [1, 0] and [1, 1]) and to say in advance whether it should be acute or obtuse. Doing the cardboard-box activity together makes three-dimensional angles concrete.

Common difficulties:

  • Using vectors that do not both start at the vertex when finding an angle of a triangle.
  • Rounding cos θ too early (for example to 0.38), which changes the angle in the first decimal place.
  • Calculator in radian mode.
  • Forgetting that a negative component gives a direction angle greater than 90°.