Tutorials › Calculus III › Finding Angles Between Three-Dimensional Vectors

Dot Products and Projections · Tutorial 55 of 999

Finding Angles Between Three-Dimensional Vectors

Use the dot product and vector magnitudes to calculate the smaller angle between two three-dimensional vectors, then report it exactly or to a chosen precision.

Beginner 9 min read

What You'll Learn

  • Identify the smaller angle between two nonzero three-dimensional vectors
  • Apply the dot-product angle formula and check that its conditions are met
  • Compute vector magnitudes and dot products from components
  • Find an exact angle or use inverse cosine for an approximate measure
  • Choose the correct calculator mode and round only the final answer
  • Recognize and correct common errors with magnitudes and inverse cosine

Turning Vector Components Into an Angle

Two nonzero vectors in three-dimensional space can point in similar, opposite, or perpendicular directions. Their components make it possible to calculate the angle between those directions, even when the vectors are not drawn. The calculation combines two quantities already defined for vectors: the dot product and the magnitude.

The result is the smaller angle between the vectors, measured from \(0\) to \(180\) degrees (or from \(0\) to \(\pi\) radians). A positive dot product gives an angle less than \(90\) degrees, a negative dot product gives an angle greater than \(90\) degrees, and a zero dot product gives an angle of \(90\) degrees. These are consequences of the angle formula.

Definition: For two nonzero vectors \(\mathbf{v},\mathbf{w}\in\mathbb{R}^3\), the smaller angle between them is the angle formed when they are placed with a common initial point, taking the value in the interval from \(0\) to \(\pi\). Its measure is determined by the dot product and the magnitudes of the vectors.

The Angle Formula

Write the vectors in component form as \(\mathbf{v}=\langle v_1,v_2,v_3\rangle\) and \(\mathbf{w}=\langle w_1,w_2,w_3\rangle\). Their dot product is \(v_1w_1+v_2w_2+v_3w_3\), and their magnitudes are the square roots of the sums of their squared components. For nonzero vectors, the angle \(\theta\) satisfies:

$$ \cos\theta = \frac{\mathbf{v}\cdot\mathbf{w}}{\|\mathbf{v}\|\,\|\mathbf{w}\|}, \qquad \theta = \cos^{-1}\!\left( \frac{\mathbf{v}\cdot\mathbf{w}}{\|\mathbf{v}\|\,\|\mathbf{w}\|} \right). $$

The inverse cosine, written \(\cos^{-1}\) or \(\arccos\), returns an angle whose cosine is the given value. It does not mean \(1/\cos\). The formula requires that both vectors are nonzero, so the denominator is positive. The Cauchy–Schwarz inequality ensures that the fraction inside the inverse cosine lies between \(-1\) and \(1\).

Key rule: Compute the dot product and both magnitudes first. Divide the dot product by the product of the magnitudes, then take the inverse cosine. Do not apply inverse cosine to the dot product alone.

Why the Formula Works

The relationship follows from the Law of Cosines. Place the vectors at a common initial point. The third side of the triangle formed by their endpoints is represented by \(\mathbf{v}-\mathbf{w}\). Its squared length can be expanded using the dot product:

$$ \|\mathbf{v}-\mathbf{w}\|^2 = (\mathbf{v}-\mathbf{w})\cdot(\mathbf{v}-\mathbf{w}) = \|\mathbf{v}\|^2+\|\mathbf{w}\|^2-2(\mathbf{v}\cdot\mathbf{w}). $$

If \(\theta\) is the included angle, the Law of Cosines gives the squared length of the same side as \(\|\mathbf{v}\|^2+\|\mathbf{w}\|^2-2\|\mathbf{v}\|\,\|\mathbf{w}\|\cos\theta\). Equating these two expressions and cancelling the matching squared-length terms gives:

$$ \mathbf{v}\cdot\mathbf{w} = \|\mathbf{v}\|\,\|\mathbf{w}\|\cos\theta. $$

Because both magnitudes are nonzero, we can divide by their product and then apply inverse cosine. This produces the angle formula. The component calculation is therefore not a separate geometric trick: it evaluates the relationship between the dot product and the included angle.

Worked Examples

Worked Example: Finding an Exact Angle in Three Dimensions

Find the smaller angle between \(\mathbf{v}=\langle 1,1,0\rangle\) and \(\mathbf{w}=\langle 1,0,1\rangle\).

First calculate the dot product, multiplying corresponding components and adding:

$$ \mathbf{v}\cdot\mathbf{w} = (1)(1)+(1)(0)+(0)(1) = 1+0+0 = 1. $$

Next calculate each magnitude:

$$ \|\mathbf{v}\| = \sqrt{1^2+1^2+0^2} = \sqrt{2}, \qquad \|\mathbf{w}\| = \sqrt{1^2+0^2+1^2} = \sqrt{2}. $$

Substitute these results into the formula:

$$ \cos\theta = \frac{1}{(\sqrt{2})(\sqrt{2})} = \frac{1}{2}. $$

The angle whose cosine is \(1/2\) is exactly \(60^\circ\), or \(\pi/3\) radians. Thus the smaller angle is \(60^\circ\). To check, substitute the result into the cosine relation: \(\cos 60^\circ=1/2\), which agrees with the calculated ratio.

Worked Example: Rounding an Acute Angle

Find the angle between \(\mathbf{v}=\langle 1,2,2\rangle\) and \(\mathbf{w}=\langle 2,1,2\rangle\), rounded to one decimal place.

The dot product is:

$$ \mathbf{v}\cdot\mathbf{w} = (1)(2)+(2)(1)+(2)(2) = 2+2+4 = 8. $$

The magnitudes are:

$$ \|\mathbf{v}\| = \sqrt{1^2+2^2+2^2} = \sqrt{9} = 3, \qquad \|\mathbf{w}\| = \sqrt{2^2+1^2+2^2} = \sqrt{9} = 3. $$

Therefore the cosine of the angle is:

$$ \cos\theta = \frac{8}{(3)(3)} = \frac{8}{9}. $$

Use inverse cosine, with the calculator set to degrees:

$$ \theta = \cos^{-1}\!\left(\frac{8}{9}\right) \approx 27.266^\circ \approx 27.3^\circ. $$

The smaller angle is approximately \(27.3^\circ\). As a check, \(\cos(27.266^\circ)\approx 0.8889\), and \(8/9\approx 0.8889\). The close agreement confirms the unrounded calculator result.

Worked Example: Finding an Obtuse Angle

Find the smaller angle between \(\mathbf{v}=\langle 1,1,0\rangle\) and \(\mathbf{w}=\langle -1,0,2\rangle\), rounded to one decimal place.

Calculate the dot product:

$$ \mathbf{v}\cdot\mathbf{w} = (1)(-1)+(1)(0)+(0)(2) = -1+0+0 = -1. $$

Calculate the magnitudes:

$$ \|\mathbf{v}\| = \sqrt{1^2+1^2+0^2} = \sqrt{2}, \qquad \|\mathbf{w}\| = \sqrt{(-1)^2+0^2+2^2} = \sqrt{5}. $$

The cosine ratio is negative:

$$ \cos\theta = \frac{-1}{(\sqrt{2})(\sqrt{5})} = -\frac{1}{\sqrt{10}}. $$

In degree mode, evaluate the inverse cosine:

$$ \theta = \cos^{-1}\!\left(-\frac{1}{\sqrt{10}}\right) \approx 108.4349^\circ \approx 108.4^\circ. $$

The angle is obtuse, consistent with the negative cosine ratio. Checking the rounded calculator result before rounding, \(\cos(108.4349^\circ)\approx -0.3162\), while \(-1/\sqrt{10}\approx -0.3162\). These values agree.

Reading and Reporting the Result

The sign and size of the dot product provide a quick consistency check. After dividing by the positive product of the magnitudes, a positive ratio must lead to an angle below \(90^\circ\); a negative ratio must lead to an angle above \(90^\circ\). A ratio of \(1\) gives \(0^\circ\), and a ratio of \(-1\) gives \(180^\circ\). If a calculator returns an angle that contradicts the sign, check the entered fraction and the calculator mode.

Inverse cosine can return angles in degrees or radians depending on the calculator setting. Check that setting before interpreting the displayed number. If an answer is requested in degrees, use degree mode; if it is requested in radians, use radian mode. Keep the exact fraction or radical expression through the calculation and round only the final angle to the requested precision.

There is no need to convert the vectors into unit vectors first. The denominator \(\|\mathbf{v}\|\,\|\mathbf{w}\|\) accounts for their lengths, leaving a ratio that depends on their directions. This is why multiplying either vector by a positive scalar does not change the angle. Reversing the direction of one vector, however, changes the sign of the dot product and changes the angle to its supplement.

Common Pitfall: Using the Wrong Magnitudes

A frequent error is to add the absolute values of the components instead of taking the square root of the sum of their squares. For the vectors \(\langle 1,1,0\rangle\) and \(\langle 1,0,1\rangle\), the dot product is \(1\). If the incorrect magnitude \(1+1+0=2\) is used for each vector, the resulting ratio is \(1/(2\cdot2)=1/4\), which suggests an angle of about \(75.5^\circ\). That is not the correct calculation.

The magnitudes must be computed from squared components. Each vector has magnitude \(\sqrt{1^2+1^2+0^2}=\sqrt{2}\), so the correct ratio is \(1/(\sqrt{2}\sqrt{2})=1/2\), giving \(60^\circ\). Checking the magnitude formula before using inverse cosine prevents this error.

A Reliable Calculation Order

1
Check the vectors.
Confirm that both vectors are nonzero, since the angle formula divides by each magnitude.
2
Calculate the dot product and magnitudes.
Multiply corresponding components for the dot product; square, add, and take the square root for each magnitude.
3
Form the cosine ratio.
Divide the dot product by the product of the magnitudes and check that the result lies between \(-1\) and \(1\).
4
Apply inverse cosine.
Use the requested angle unit and round only after obtaining the angle.

This order keeps the algebra visible and makes it easier to locate mistakes. In particular, retaining the ratio as a fraction or radical until the inverse-cosine step often avoids unnecessary rounding.

Check Your Understanding

For each question, show the dot product and magnitudes before finding an angle.

  1. Find the smaller angle between \(\langle 1,0,0\rangle\) and \(\langle 1,1,0\rangle\). Give an exact answer.
  2. For \(\mathbf{v}=\langle 2,0,1\rangle\) and \(\mathbf{w}=\langle 1,1,0\rangle\), write the exact cosine ratio, then find the angle to one decimal place.
  3. What condition must each vector satisfy for the angle formula to be defined? Explain the issue if one vector is the zero vector.
  4. If the cosine ratio is negative, should the smaller angle be acute or obtuse? Explain briefly.
  5. A calculation gives a cosine ratio of \(1.2\). What does that indicate you should check?