If you’re learning about angles and vectors in math class, your teacher probably just assigned you problems to find the angle between 2 vectors. It can definitely seem a little confusing to get started, so that’s why we’re here to help! In this article, we’ll tell you about the 2 formulas that find the angle between 2 vectors and walk you through how to use them. Read on to get your math problems solved!
Things You Should Know
- Use the formula ( • ) / ( || || || || ) to find the angle between vectors using the dot product.
- To calculate the dot product, multiply the same direction coordinates of each vector and add the results together.
- Then, find each vector’s magnitude using the Pythagorean Theorem, or √(u 1 2 + u 2 2 ). Plug the arccos, dot product, and magnitudes into a calculator to get the angle.
- Or, use the cross product formula ( ) / ( || || || || ) to get the angle between the vectors.
Steps
Using the Dot Product Formula
-
Use the formula: ( • ) / ( || || || || ). The angle between 2 vectors is where the tails of 2 vectors, or line segments, meet. Each vector has a magnitude, or length, and a direction that it’s heading. So, to find the angle between 2 vectors, you use the above formula where: [1] X Research source
- is the angle between the vectors.
- is the inverse of cosine, or the arc cos.
- • is the dot product of vector and .
- || || || || is the magnitude of vector and .
-
Identify the vectors’ coordinates in your math problem. Most math problems give you the dimensional coordinates of each vector, which are sometimes also called components. You use each vector’s coordinates to find their magnitudes and combined dot product. If your math problem already gives the vectors’ magnitudes, skip the magnitude step below. [2] X Research source
- For example, find the angle between vector and vector . Vector has coordinates at (2, 2) and vector has coordinates at (0, 3).
- Sometimes, vectors are written as = 2 i + 2 j and = 0 i + 3 j .
- While our example uses two-dimensional vectors, finding the angle between 3-dimensional vectors follows the same steps.
Advertisement -
Calculate the magnitude of each vector. Picture a right triangle drawn from the vector's x-component, its y-component, and the vector itself. The vector forms the hypotenuse of the triangle, so to find its magnitude, simply use the Pythagorean theorem . Just plug each vector’s coordinates into the theorem. [3] X Research source
- In the Pythagorean theorem of a 2 + b 2 + c 2 , the vector’s magnitude is denoted by c. So, just rewrite the equation to isolate the magnitude on one side: || u || = √(u 1 2 + u 2 2 ) with u 1 2 + u 2 2 being the vector’s x and y coordinates.
- Using our example, find the magnitudes for vector
at (2, 2) and vector
at (0, 3).
- Insert
coordinates into the theorem: √2 2
+ 2 2
= √8 = 2√2. So, ||
u ||
= 2√2.
- Find magnitude: √0 2 + 3 2 = √9. So, || || = 3.
- Insert
coordinates into the theorem: √2 2
+ 2 2
= √8 = 2√2. So, ||
u ||
= 2√2.
- If a vector is 3-dimensional or has more than 2 components, simply continue adding +u 3 2 + u 4 2 + … to the Pythagorean Theorem.
-
Calculate the dot product of the 2 vectors. The dot product is a way to multiply vectors, which is also commonly called the scalar product .To calculate the dot product, multiply the same direction coordinates of the vectors, then add the results together.For computer graphics programs, see Tips before you continue. [4] X Research source
- Using our example,
= (2, 2) and
= (0, 3). Find
•
.
- Multiply the x-coordinates of and and the y-coordinates. u x v x + u y v y = (2)(0) + (2)(3) = 0 + 6 = 6.
- 6 is the dot product of vector and .
Defining Dot Product
In mathematical terms, • = u 1 v 1 + u 2 v 2 , where (u 1 , u 2 ) are the coordinates for vector u. If your vector has more than 2 components, simply continue to add + u 3 v 3 + u 4 v 4 ... - Using our example,
= (2, 2) and
= (0, 3). Find
•
.
-
Plug the dot product and each vector’s magnitude into the formula. Remember, the formula is ( • ) / ( || || || || ) Now that you know both the dot product and the magnitudes of each vector, simply enter them into this formula.
Finding Cosine with Dot Product and Magnitude
In our example, θ = cos -1 6 / ( 2√2 • 3 ). Simplify to get θ = cos -1 (√2 / 2). -
Use a scientific calculator to find the angle based on the cosine. On most calculators, use either the arccos or cos -1 function on your calculator to find the angle θ. Simply enter “arccos” and the dot product divided by the vectors’ magnitudes. For some results, use the unit circle to work out the angle.
Finding an Angle with Cosine
In our example, θ = cos -1 (√2 / 2). Enter "arccos(√2 / 2)" in your calculator to get θ = 45º. Alternatively, find the angle θ on the unit circle where cosθ = √2 / 2.
Using the Cross Product Formula
-
Use the formula: ( ) / ( || || || || ). This formula uses sine and the cross product of vectors to find the angle between them. Unlike the dot product formula, which gives you a scalar answer, the cross product formula gives you an answer as a vector. In this formula: [5] X Research source
- is the angle between the vectors.
- is the inverse of sine, or the arc sin.
- is the cross product of vector and .
- || || || || is the magnitude of vector and .
-
Find the cross product using the vectors’ coordinates. In most math problems, you have the dimensional coordinates, or components, of each vector written as . To find the cross product, make a matrix with the first vector’s coordinates in the first row and the second vector’s coordinates in the second row. Calculate the i, j, and k values for each matrix section. [6] X Research source
- For example, find the angle between 2 vectors where
is 1i - 2j + 3k and
is 10i + 1j - 3k.
- Draw a matrix for and : 1 2 3 is on the top row, and 10 1 -3 is on the bottom row.
- Solve the matrix for i: i = (u j
* v k
) - (v j
* u k
)
i = (6 - 3) = 3 - Solve the matrix for j: j = (u i
* v k
) - (v i
* u k
)
j = (-3 - 30) = -33 - Solve the matrix for k: k = (u i
* v j
) - (v i
* u j
)
k = (1 - -20) = 21 - Find the coordinates for i - j + k: 3i - -33j + 21k = 3i + 33j + 21k or <3, 33, 21>
- For example, find the angle between 2 vectors where
is 1i - 2j + 3k and
is 10i + 1j - 3k.
-
Calculate the magnitude of the cross product. The final step in finding the cross product of vectors is finding the magnitude of their coordinates. Remember, use the Pythagorean Theorem to find a vector’s magnitude. Just plug in the i, k, j coordinates of the cross product of the vectors to get their magnitude. [7] X Research source
- The cross product of
x
is 3i + 33j + 21k or <3, 33, 21>.
- Use the Pythagorean Theorem to find the magnitude: || u x v || = √(i 2 + j 2 + k 2 )
- Plug in 3i + 33j + 21k into the theorem: √((3) 2 + (33) 2 + (21) 2 )
- Solve: √9 + 1089 + 441 = √1539
- The cross product of vector x = √1539
- The cross product of
x
is 3i + 33j + 21k or <3, 33, 21>.
-
Find the magnitude of each vector. Now, calculate the magnitude of each vector using their dimensional coordinates. Just plug the coordinates into the Pythagorean Theorem like in the step above. [8] X Research source
- In the example,
is 1i - 2j + 3k and
is 10i + 1j - 3k.
- Find the magnitude of : || u || = √i 2 + j 2 + k 2 = √((1) 2 + (-2) 2 + (3) 2 ) = √1 + 4 + 9 = √14
- Find the magnitude of : || v || = √((10) 2 + (1) 2 + (-3) 2 ) = √100 + 1 + 9 = √110
- In the example,
is 1i - 2j + 3k and
is 10i + 1j - 3k.
-
Plug the cross product and the vectors’ magnitude into the formula. Now that you have the vectors’ cross product and magnitudes, simply enter them into the formula ( ) / ( || || || || ). [9] X Research source
- In our example, θ = sin -1 (√1539 / √14 * √110)
-
Find the angle using a calculator. Simply take the inverse sine of the cross product and magnitudes to find the angle between the vectors. Using your calculator, find the arcsin or sin -1 function. Then, enter in the cross product and magnitude. [10] X Research source
- In our example, enter “arcsin(√1539 / √14 * √110) into your calculator to get θ = 88.5º.
Understanding the Dot Product Formula
-
Understand the purpose of the angle formula. This formula was not derived from existing rules. Instead, it was created as a definition of 2 vectors' dot product and the angle between them. However, this decision was not arbitrary. With a look back to basic geometry, you see why this formula results in intuitive and useful definitions.
- The examples below use 2-dimensional vectors because these are the most intuitive to use. Vectors with 3 or more components use the same formula.
-
Review the Law of Cosines used in the formula. Take an ordinary triangle, with angle θ between sides a and b, and opposite side c. The Law of Cosines states that c 2 = a 2 + b 2 -2ab cos (θ). This is derived fairly easily from basic geometry. [11] X Research source
-
Connect 2 vectors to form a triangle. Sketch a pair of 2D vectors on paper, vectors and , with angle θ between them. Draw a third vector between them to make a triangle. In other words, draw vector such that + = . This vector = - . [12] X Research source
-
Write the Law of Cosines for the triangle. Insert the length of the "vector triangle" sides in our example into the Law of Cosines: [13] X Research source
- || (a - b) || 2 = || a || 2 + || b || 2 - 2 || a || || b || cos (θ)
-
Write the Law of Cosines using the dot product of vector a and b. Remember, the dot product is the magnification of 1 vector projected onto another. A vector's dot product with itself doesn't require any projection, since there is no difference in direction. This means that • = || a || 2 . Use this fact to rewrite the equation: [14] X Research source
- ( - ) • ( - ) = • + • - 2 || a || || b || cos (θ)
-
Rewrite the dot product into the angle formula. Expand the left side of the formula, then simplify to reach the formula used to find angles. [15] X Research source
- • - • - • + • = • + • - 2 || a || || b || cos (θ)
- - • - • = -2 || a || || b || cos (θ)
- -2( • ) = -2 || a || || b || cos (θ)
- • = || a || || b || cos (θ)
Community Q&A
-
QuestionHow do I find the angle between two vectors? For example, vector A = 4i + 2j - 2k and vector B = 3i +2j + 3k?This answer was written by one of our trained team of researchers who validated it for accuracy and comprehensiveness.wikiHow Staff EditorStaff AnswerUse the formula with the dot product, θ = cos^-1 (a * b) / ||a|| * ||b||. To get the dot product, multiply Ai by Bi, Aj by Bj, and Ak by Bk then add the values together. To find the magnitude of A and B, use the Pythagorean Theorem (√(i^2 + j^2 + k^2). Then, use your calculator to take the inverse cosine of the dot product divided by the magnitudes and get the angle.
-
QuestionIf the cosine formula gives me 0, it means that the vector are perpendicular. But how do I know if it's 90° or -90° ?This answer was written by one of our trained team of researchers who validated it for accuracy and comprehensiveness.wikiHow Staff EditorStaff AnswerThe angle between 2 vectors is always between 0° and 180°, so the angle is 90°.
-
QuestionIn the above example cosθ was 1/√2. But here cosθ can be 45 degrees or 315 degrees. Why is that the answer is not 315?This answer was written by one of our trained team of researchers who validated it for accuracy and comprehensiveness.wikiHow Staff EditorStaff AnswerWhen you find the angle between 2 vectors, the angle is always going to be between 0° and 180°.
Video
Tips
- If you are working on a computer graphics program, you most likely only care about the direction of the vectors, not their length. Take these steps to simplify the equations and speed up your program: [16] X Research source
- Normalize each vector so the length becomes 1. To do this, divide each component of the vector by the vector's length.
- Take the dot product of the normalized vectors instead of the original vectors.
- Since the length equals 1, leave the length terms out of your equation. Your final equation for the angle is arccos( • ).
Thanks - For a quick plug and solve, use this formula for any pair of two-dimensional vectors: cosθ = (u 1 • v 1 + u 2 • v 2 ) / (√(u 1 2 • u 2 2 ) • √(v 1 2 • v 2 2 )).Thanks
- The cosine formula tells you whether the angle between vectors is acute or obtuse. Start with cosθ = ( • ) / ( || || || || ):
- The left side and right sides of the equation must have the same sign (positive or negative).
- Since the lengths are always positive, cosθ must have the same sign as the dot product.
- Therefore, if the dot product is positive, cosθ is positive. We are in the first quadrant of the unit circle, with θ < π / 2 or 90º. The angle is acute.
- If the dot product is negative, cosθ is negative. We are in the second quadrant of the unit circle, with π / 2 < θ ≤ π or 90º < θ ≤ 180º. The angle is obtuse.
Thanks
References
- ↑ https://www.khanacademy.org/math/linear-algebra/vectors_and_spaces/
- ↑ https://activecalculus.org/multi/S-9-3-Dot-Product.html
- ↑ https://www.mathsisfun.com/algebra/vectors-dot-product.html
- ↑ https://www.mathsisfun.com/algebra/vectors-dot-product.html
- ↑ https://youtu.be/CclStzekkhU?t=171
- ↑ https://youtu.be/TYCwzCYUwZE?t=28
- ↑ https://youtu.be/TYCwzCYUwZE?t=96
- ↑ https://youtu.be/CclStzekkhU?t=118
- ↑ https://youtu.be/CclStzekkhU?t=187
- ↑ https://youtu.be/CclStzekkhU?t=278
- ↑ https://www.mathsisfun.com/algebra/trig-cosine-law.html
- ↑ https://www.khanacademy.org/math/linear-algebra/vectors_and_spaces/dot_cross_products/v/defining-the-angle-between-vectors
- ↑ https://activecalculus.org/multi/S-9-3-Dot-Product.html
- ↑ http://physics.info/vector-multiplication/
- ↑ https://activecalculus.org/multi/S-9-3-Dot-Product.html
- ↑ http://www.euclideanspace.com/maths/algebra/vectors/angleBetween/index.htm
About This Article
1. Calculate the length of each vector.
2. Calculate the dot product of the 2 vectors.
3. Calculate the angle between the 2 vectors with the cosine formula.
4. Use your calculator's arccos or cos^-1 to find the angle. For specific formulas and example problems, keep reading below!
Reader Success Stories
- "My A-level is in 2 hours, and I have never been able to do this topic until now! I owe wikiHow. Big love to the genius behind this. " ..." more