Vector Operations in Space: Learn It 2

Using the Dot Product to Find the Angle between Two Vectors

When you place two nonzero vectors in standard position (starting from the origin), they form an angle between them. The dot product provides a powerful way to find this angle.

This figure is two vectors with the same initial point. The first vector is labeled “u,” and the second vector is labeled “v.” The angle between the two vectors is labeled “theta.”
Figure 1. Let [latex]θ[/latex] be the angle between two nonzero vectors [latex]{\bf{u}}[/latex] and [latex]{\bf{v}}[/latex] such that [latex]0≤θ≤π[/latex].

The dot product has both algebraic and geometric interpretations. We’ve seen the algebraic version (multiply components and add). The geometric version connects the dot product to angles.

geometric dot product formula

The dot product of two vectors is the product of the magnitude of each vector and the cosine of the angle between them:

[latex]\mathbf{u} \cdot \mathbf{v} = ||\mathbf{u} ||\;||\mathbf{v} ||\cos{\theta}[/latex].

Proof


Place vectors [latex]\mathbf{u}[/latex] and [latex]\mathbf{v}[/latex] in standard position and consider the vector [latex]\mathbf{v} - \mathbf{u}[/latex] (Figure 2). These three vectors form a triangle with side lengths [latex]||\mathbf{u}||[/latex], [latex]||\mathbf{v}||[/latex], and [latex]||\mathbf{v} - \mathbf{u}||[/latex].

This figure is two vectors with the same initial point. The first vector is labeled “u,” and the second vector is labeled “v.” The angle between the two vectors is labeled “theta.” There is also a third vector from the terminal point of vector u to the terminal point of vector v. It is labeled “v – u.”
Figure 2. The lengths of the sides of the triangle are given by the magnitudes of the vectors that form the triangle.

The law of cosines describes the relationship among the side lengths of the triangle and the angle [latex]\theta[/latex]. Applying the law of cosines here gives

[latex]||\mathbf{v} - \mathbf{u}||^2 = ||\mathbf{u}||^2 + ||\mathbf{v}||^2 - 2||\mathbf{u}||\;||\mathbf{v}||\cos{\theta}[/latex].

The dot product provides a way to rewrite the left side of this equation:

[latex]\begin{align*} ||\mathbf{v} - \mathbf{u}||^2 &= (\mathbf{v} - \mathbf{u}) \cdot (\mathbf{v} - \mathbf{u})\\ &= (\mathbf{v} - \mathbf{u}) \cdot \mathbf{v}-(\mathbf{v} - \mathbf{u}) \cdot \mathbf{u}\\ &= \mathbf{v} \cdot \mathbf{v} - \mathbf{u} \cdot \mathbf{v} - \mathbf{v} \cdot \mathbf{u}+\mathbf{u} \cdot \mathbf{u}\\ &= \mathbf{v} \cdot \mathbf{v} - \mathbf{u} \cdot \mathbf{v} - \mathbf{u} \cdot \mathbf{v}+\mathbf{u} \cdot \mathbf{u}\\ &= ||\mathbf{v}||^2 - 2 \mathbf{u} \cdot \mathbf{v} + ||\mathbf{u}||^2.\\ \end{align*}[/latex]

Substituting into the law of cosines yields

[latex]\begin{align*} ||\mathbf{v} - \mathbf{u}||^2 &= ||\mathbf{u}||^2 + ||\mathbf{v}||^2 - 2||\mathbf{u}||\;||\mathbf{v}||\cos{\theta}\\ ||\mathbf{v}||^2 - 2 \mathbf{u} \cdot \mathbf{v} + ||\mathbf{u}||^2 &= ||\mathbf{u}||^2 + ||\mathbf{v}||^2 - 2||\mathbf{u}||\;||\mathbf{v}||\cos{\theta}\\ - 2 \mathbf{u} \cdot \mathbf{v} &= - 2||\mathbf{u}||\;||\mathbf{v}||\cos{\theta}\\ \mathbf{u} \cdot \mathbf{v} &= ||\mathbf{u}||\;||\mathbf{v}||\cos{\theta}.\\ \end{align*}[/latex]

[latex]_\blacksquare[/latex]

Finding Angles Between Vectors

We can rearrange the geometric formula to solve for the angle:

[latex]\cos \theta = \frac{\mathbf{u} \cdot \mathbf{v}}{||\mathbf{u}|| , ||\mathbf{v}||}[/latex]

Since we measure the smallest angle between vectors, we have [latex]0° \leq \theta \leq 180°[/latex] (or [latex]0 \leq \theta \leq \pi[/latex] radians). The inverse cosine function is unique over this range, so we can determine [latex]\theta[/latex] precisely.

Find the measure of the angle between each pair of vectors.

  1. [latex]\mathbf{i} + \mathbf{j} + \mathbf{k}[/latex] and [latex]2\mathbf{i} - \mathbf{j} - 3\mathbf{k}[/latex]
  2. [latex]\langle 2,5,6 \rangle[/latex] and [latex]\langle -2,-4,4 \rangle[/latex]

Interpreting Different Angles

The value of [latex]\cos \theta[/latex] tells us about the relationship between the vectors:

  • Acute angle [latex](0 < \theta < 90°)[/latex]: [latex]\cos \theta > 0[/latex] (vectors point in “similar” directions)
  • Right angle [latex](\theta = 90°)[/latex]: [latex]\cos \theta = 0[/latex] (vectors are perpendicular)
  • Obtuse angle [latex](90° < \theta < 180°)[/latex]: [latex]\cos \theta < 0[/latex] (vectors point in “opposite” directions)
  • Same direction [latex](\theta = 0°)[/latex]: [latex]\cos \theta = 1[/latex]
  • Opposite directions [latex](\theta = 180°)[/latex]: [latex]\cos \theta = -1[/latex]

If [latex]\cos{\theta} = 0[/latex], then the vectors, when placed in standard position, form a right angle.

This figure has 5 images. The first image has two vectors u and v. The angle between these two vectors is theta. Theta is an acute angle. The second image is has two vectors u and v. The angle between these vectors is theta. Theta is an obtuse angle. The third image is vectors u and v in opposite directions. The angle between u and v is a straight angle. The fourth image is u and v in the same direction. The fifth image is u and v with angle theta between them as a right angle.
Figure 3. (a) An acute angle has [latex]0< \cos{\theta}<1[/latex]. (b) An obtuse angle has [latex]−1<\cos\theta<0[/latex]. (c) A straight line has [latex]\cos\theta=−1[/latex]. (d) If the vectors have the same direction, [latex]\cos\theta=1[/latex]. (e) If the vectors are orthogonal (perpendicular), [latex]\cos\theta=0[/latex]

Orthogonal Vectors

The right angle case is so important that it has special terminology and a simple test. Nonzero vectors [latex]\mathbf{u}[/latex] and [latex]\mathbf{v}[/latex] are orthogonal (perpendicular) if and only if [latex]\mathbf{u} \cdot \mathbf{v} = 0[/latex].

orthogonal vectors

The nonzero vectors [latex]\mathbf{u}[/latex] and [latex]\mathbf{v}[/latex] are orthogonal vectors if and only if [latex]\mathbf{u} \cdot \mathbf{v} = 0[/latex].

Proof


Let [latex]\mathbf{u}[/latex] and [latex]\mathbf{v}[/latex] be nonzero vectors, and let [latex]\theta[/latex] denote the angle between them. First, assume [latex]\mathbf{u} \cdot \mathbf{v} = 0[/latex]. Then

[latex]||\mathbf{u}||\;||\mathbf{v}||\cos{\theta} = 0[/latex].

However, [latex]||\mathbf{u}|| \neq 0[/latex] and [latex]||\mathbf{v}|| \neq 0[/latex], so we must have [latex]\cos{\theta} = 0[/latex]. Hence, [latex]\theta = 90^\circ[/latex], and the vectors are orthogonal.

Now assume [latex]\mathbf{u}[/latex] and [latex]\mathbf{v}[/latex] are orthogonal. Then [latex]\theta = 90^\circ[/latex] and we have

[latex]\mathbf{u} \cdot \mathbf{v} = ||\mathbf{u}||\;||\mathbf{v}||\cos{\theta} = ||\mathbf{u}||\;||\mathbf{v}||\cos{90^\circ} = ||\mathbf{u}||\;||\mathbf{v}||(0) = 0[/latex].

[latex]_\blacksquare[/latex]

Terminology: We say vectors are orthogonal, lines are perpendicular, and surfaces have normal vectors. All three terms indicate 90° angles, but context determines which to use.
Determine whether [latex]\mathbf{p} = \langle 1,0,5 \rangle[/latex] and [latex]\mathbf{q} = \langle 10,3,-2 \rangle[/latex] are orthogonal vectors.

Let [latex]\mathbf{v} = \langle 2,3,3 \rangle[/latex]. Find the measures of the angles formed by the following vectors.

  1. [latex]\mathbf{v}[/latex] and [latex]\mathbf{i}[/latex]
  2. [latex]\mathbf{v}[/latex] and [latex]\mathbf{j}[/latex]
  3. [latex]\mathbf{v}[/latex] and [latex]\mathbf{k}[/latex]

Direction Angles and Direction Cosines

The angles a vector makes with the coordinate axes are called direction angles. These are crucial in applications like engineering, where precise angular measurements matter—a small error in a rocket’s launch angle can cause it to miss its target by hundreds of miles.

Direction angles are often calculated by using the dot product and the cosines of the angles, called the direction cosines. Therefore, we define both these angles and their cosines.

direction angles

The direction angles of a vector are the angles it makes with the positive [latex]x[/latex]-, [latex]y[/latex]-, and [latex]z[/latex]-axes. The direction cosines are the cosines of these angles.

This figure is the first octant of the 3-dimensional coordinate system. It has the standard unit vectors drawn on axes x, y, and z. There is also a vector drawn in the first octant labeled “v.” The angle between the x-axis and v is labeled “alpha.” The angle between the y-axis and vector v is labeled “beta.” The angle between the z-axis and vector v is labeled “gamma.”
Figure 5. Angle [latex]\alpha[/latex] is formed by vector [latex]{\bf{v}}[/latex] and unit vector [latex]{\bf{i}}[/latex]. Angle [latex]\beta[/latex] is formed by vector [latex]{\bf{v}}[/latex] and unit vector [latex]{\bf{j}}[/latex]. Angle [latex]\gamma[/latex] is formed by vector [latex]{\bf{v}}[/latex] and unit vector [latex]{\bf{k}}[/latex].

 

For vector [latex]\mathbf{v} = \langle 2,3,3 \rangle[/latex], the direction cosines are [latex]\cos \alpha = \frac{2}{\sqrt{22}}[/latex], [latex]\cos \beta = \frac{3}{\sqrt{22}}[/latex], and [latex]\cos \gamma = \frac{3}{\sqrt{22}}[/latex], giving direction angles [latex]\alpha = 1.130[/latex] rad, [latex]\beta = 0.877[/latex] rad, and [latex]\gamma = 0.877[/latex] rad.