Given two non-zero vectors A and B, how do you find the angle between them? Take, for example, A = (2, -1, 2), B = (1, -1, 0) and find the angle between them.

1 answer

To find the angle between two vectors A and B, you can use the dot product formula:

A · B = |A| |B| cosθ

where A · B is the dot product of A and B, |A| and |B| are the magnitudes of A and B respectively, and θ is the angle between them.

Let's calculate it using the given vectors A = (2, -1, 2) and B = (1, -1, 0):

1. Find the magnitudes of A and B:
|A| = sqrt((2)^2 + (-1)^2 + (2)^2) = sqrt(9) = 3
|B| = sqrt((1)^2 + (-1)^2 + (0)^2) = sqrt(2)

2. Calculate the dot product of A and B:
A · B = (2)(1) + (-1)(-1) + (2)(0) = 2 + 1 + 0 = 3

3. Substitute the values into the dot product formula to find the angle:
3 = (3)(sqrt(2))cosθ

4. Solve for θ:
cosθ = 3 / (3√2) = 1 / √2 = √2 / 2

Now, to find θ, we take the inverse cosine (arc cosine) of this value:
θ = cos^(-1)(√2 / 2) ≈ 45°

Therefore, the angle between vectors A = (2, -1, 2) and B = (1, -1, 0) is approximately 45°.