Krista King Math | Online math help

View Original

Angle between two vectors

Formula for the angle between vectors

To find the angle between two vectors, we’ll use the formula

???\cos{\theta}=\frac{a\cdot b}{|a||b|}???

where ???a??? and ???b??? are the given vectors, ???a\cdot{b}??? is the dot product of the vectors, ???|a|??? is the length of ???a???, and ???|b|??? is the length of ???b???. To find the length of the vectors, we’ll use the distance formula

???D=\sqrt{\left(x_2-x_1\right)^2+\left(y_2-y_1\right)^2+\left(z_2-z_1\right)^2}???

How to calculate the angle between two vectors


Take the course

Want to learn more about Calculus 3? I have a step-by-step course for that. :)


Finding the angle between two vectors in three dimensions

Example

Find the angle between the vectors.

???a=\langle4,-2,3\rangle???

???b=\langle1,3,-1\rangle???

We’ll start by finding the dot product of ???a??? and ???b???, ???a\cdot b???.

???a\cdot{b}=(4)(1)+(-2)(3)+(3)(-1)???

???a\cdot{b}=4-6-3???

???a\cdot{b}=-5???

Now we’ll use the distance formula to find the length of each vector, remembering that the initial point of both vectors is the origin, and the terminal points are given by ???(4,-2,3)??? and ???(1,3,-1)???.

???D=\sqrt{\left(x_2-x_1\right)^2+\left(y_2-y_1\right)^2+\left(z_2-z_1\right)^2}???

???|a|=D_a=\sqrt{(4-0)^2+(-2-0)^2+(3-0)^2}???

???|a|=D_a=\sqrt{16+4+9}???

???|a|=D_a=\sqrt{29}???

and

???|b|=D_b=\sqrt{(1-0)^2+(3-0)^2+(-1-0)^2}???

???|b|=D_b=\sqrt{1+9+1}???

???|b|=D_b=\sqrt{11}???

Plugging everything we’ve calculated into our formula for the angle between two vectors, we get

???\cos{\theta}=\frac{a\cdot{b}}{|a||b|}???

???\cos{\theta}=\frac{-5}{\left|\sqrt{29}\right|\left|\sqrt{11}\right|}???

???\cos{\theta}=\frac{-5}{\left|\sqrt{319}\right|}???

???\theta=106.3^\circ???


Get access to the complete Calculus 3 course