normal

Calculating the Angle Between Two Vectors

In today's tutorial, we are going to demystify the process of calculating the angle α between two vectors v1 and v2, utilizing the following formula: $$ \alpha = \arccos ( \frac{ \vec{v_1} \cdot \vec{v_2} }{|\vec{v_1} | \cdot |\vec{v_2} | } ) $$

Let's dive into a tangible example to clarify the process.

Imagine we have two vectors v1 and v2

$$ \vec{v_1} = \begin{pmatrix} x_1 \\ y_1 \end{pmatrix} = \begin{pmatrix} 1 \\ 3 \end{pmatrix} $$

$$ \vec{v_2} = \begin{pmatrix} x_2 \\ y_2 \end{pmatrix} = \begin{pmatrix} 4 \\ 2 \end{pmatrix} $$

In this scenario, the x and y components of the vectors represent the (x,y) coordinates of the vectors within a Cartesian plane.

These vectors, v1 and v2, constitute an angle α, the measurement of which is our objective to discover.

two vectors in the plane

To accomplish this, we first realize that the dot product of the two vectors is equal to the product of their magnitudes and the cosine of the angle α that exists between them:

$$ \vec{v_1} \cdot \vec{v_2} = |\vec{v_1} | \cdot |\vec{v_2} | \cdot \cos \alpha $$

From this, we can extract the cosine of the angle α

$$ \cos \alpha = \frac{ \vec{v_1} \cdot \vec{v_2} }{|\vec{v_1} | \cdot |\vec{v_2} | } $$

By taking the arccosine of both sides of the equation, we find:

$$ \arccos( \cdot \cos \alpha ) = \arccos ( \frac{ \vec{v_1} \cdot \vec{v_2} }{|\vec{v_1} | \cdot |\vec{v_2} | } ) $$

This reveals that the arccosine of the cosine of α is the angle α

$$ \alpha = \arccos ( \frac{ \vec{v_1} \cdot \vec{v_2} }{|\vec{v_1} | \cdot |\vec{v_2} | } ) $$

Therefore, we see that the angle α is the ratio of the dot product of the vectors to the product of the vectors' magnitudes.

the angle

To determine the angle α between the two vectors, we need to find the magnitudes of both vectors. We can do this using the Pythagorean theorem:

$$ | \vec{v_1} | = \sqrt{3^2 +1^2 } = \sqrt{10} $$

$$ | \vec{v_2} | = \sqrt{4^2 +2^2 } = \sqrt{20} $$

The magnitudes |v1| and |v2| represent the lengths of the two vectors.

the magnitude of the vectors

Having these magnitudes |v1| = √10 and |v2| = √20, we can substitute them into our primary formula:

$$ \alpha = \arccos ( \frac{ \vec{v_1} \cdot \vec{v_2} }{|\vec{v_1} | \cdot |\vec{v_2} | } ) $$

$$ \alpha = \arccos ( \frac{ \vec{v_1} \cdot \vec{v_2} }{\sqrt{10} \cdot \sqrt{20} } ) $$

Simplified further, we find

$$ \alpha = \arccos ( \frac{ \vec{v_1} \cdot \vec{v_2} }{\sqrt{200} } ) $$

Next, calculate the dot product of the two vectors

$$ \vec{v_1} \cdot \vec{v_2} = x_1 \cdot x_2 + y_1 \cdot y_2 = 1 \cdot 4 + 3 \cdot 2 = 4+6=10 $$

Substitute this dot product, v1·v2 = 10, back into the formula

$$ \alpha = \arccos ( \frac{ \vec{v_1} \cdot \vec{v_2} }{\sqrt{200} } ) $$

$$ \alpha = \arccos ( \frac{ 10 }{\sqrt{200} } ) $$

$$ \alpha = \arccos ( 0.71 ) $$

Finally, compute the arccosine of 0.71

$$ \alpha = \arccos ( 0.71 ) = 45° $$

$$ \alpha = 45° $$

We've reached the end of our calculation journey: α = 45°. This is the measure of the angle between our two vectors.

the angle between two vectors

Let's verify our results. We could use tools like Geogebra for this. Simply create two vectors with the same coordinates we used and calculate the angle between them.
verify

Thanks for following along with these linear algebra lessons from Nigiara. Stay tuned for more insightful tutorials!




Report a mistake or post a question




FacebookTwitterLinkedinLinkedin