2 Simple Ways to Calculate the Angle Between Two Vectors

Learn how to take the dot or cross product of 2 vectors to find the angle between them

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 √(u12 + u22). 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.
Method 1
Method 1 of 3:

Using the Dot Product Formula

  1. How.com.vn English: Step 1 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]
    • 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 .
  2. How.com.vn English: Step 2 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]
    • 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 = 2i + 2j and = 0i + 3j.
    • While our example uses two-dimensional vectors, finding the angle between 3-dimensional vectors follows the same steps.
    Advertisement
  3. How.com.vn English: Step 3 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]
    • In the Pythagorean theorem of a2 + b2 + c2, the vector’s magnitude is denoted by c. So, just rewrite the equation to isolate the magnitude on one side: ||u|| = √(u12 + u22) with u12 + u22 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: √22 + 22 = √8 = 2√2. So, ||u|| = 2√2.
      • Find magnitude: √02 + 32 = √9. So, |||| = 3.
    • If a vector is 3-dimensional or has more than 2 components, simply continue adding +u32 + u42 + … to the Pythagorean Theorem.
  4. How.com.vn English: Step 4 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]
    • Using our example, = (2, 2) and = (0, 3). Find .
      • Multiply the x-coordinates of and and the y-coordinates. uxvx + uyvy = (2)(0) + (2)(3) = 0 + 6 = 6.
      • 6 is the dot product of vector and .

    Defining Dot Product
    In mathematical terms, = u1v1 + u2v2, where (u1, u2) are the coordinates for vector u. If your vector has more than 2 components, simply continue to add + u3v3 + u4v4...

  5. How.com.vn English: Step 5 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-16 / (2√23). Simplify to get θ = cos-1(√2 / 2).

  6. How.com.vn English: Step 6 Use a scientific...
    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.

  7. Advertisement
Method 2
Method 2 of 3:

Using the Cross Product Formula

  1. How.com.vn English: Step 1 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]
    • 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 .
  2. How.com.vn English: Step 2 Find the cross...
    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]
    • 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 = (uj * vk) - (vj * uk)
        i = (6 - 3) = 3
      • Solve the matrix for j: j = (ui * vk) - (vi * uk)
        j = (-3 - 30) = -33
      • Solve the matrix for k: k = (ui * vj) - (vi * uj)
        k = (1 - -20) = 21
      • Find the coordinates for i - j + k: 3i - -33j + 21k = 3i + 33j + 21k or <3, 33, 21>
  3. How.com.vn English: Step 3 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]
    • The cross product of x is 3i + 33j + 21k or <3, 33, 21>.
      • Use the Pythagorean Theorem to find the magnitude: ||u x v|| = √(i2 + j2 + k2)
      • 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
  4. How.com.vn English: Step 4 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]
    • In the example, is 1i - 2j + 3k and is 10i + 1j - 3k.
      • Find the magnitude of : ||u|| = √i2 + j2 + k2 = √((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
  5. How.com.vn English: Step 5 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]
    • In our example, θ = sin-1(√1539 / √14 * √110)
  6. How.com.vn English: Step 6 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]
    • In our example, enter “arcsin(√1539 / √14 * √110) into your calculator to get θ = 88.5º.
  7. Advertisement
Method 3
Method 3 of 3:

Understanding the Dot Product Formula

  1. How.com.vn English: Step 1 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.
  2. How.com.vn English: Step 2 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 c2 = a2 + b2 -2abcos(θ). This is derived fairly easily from basic geometry.[11]
  3. How.com.vn English: Step 3 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]
  4. How.com.vn English: Step 4 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]
    • ||(a - b)||2 = ||a||2 + ||b||2 - 2||a|| ||b||cos(θ)
  5. How.com.vn English: Step 5 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]
    • ( - ) • ( - ) = + - 2||a|| ||b||cos(θ)
  6. How.com.vn English: Step 6 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]
    • - - + = + - 2||a|| ||b||cos(θ)
    • - - = -2||a|| ||b||cos(θ)
    • -2() = -2||a|| ||b||cos(θ)
    • = ||a|| ||b||cos(θ)
  7. Advertisement

Community Q&A

Search
Add New Question
  • Question
    How do I find the angle between two vectors? For example, vector A = 4i + 2j - 2k and vector B = 3i +2j + 3k?
    How.com.vn English: How.com.vn Staff Editor
    This answer was written by one of our trained team of researchers who validated it for accuracy and comprehensiveness.
    How.com.vn English: How.com.vn Staff Editor
    How.com.vn Staff Editor
    Staff Answer
    Use 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.
  • Question
    If the cosine formula gives me 0, it means that the vector are perpendicular. But how do I know if it's 90° or -90° ?
    How.com.vn English: How.com.vn Staff Editor
    This answer was written by one of our trained team of researchers who validated it for accuracy and comprehensiveness.
    How.com.vn English: How.com.vn Staff Editor
    How.com.vn Staff Editor
    Staff Answer
    The angle between 2 vectors is always between 0° and 180°, so the angle is 90°.
  • Question
    In 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?
    How.com.vn English: How.com.vn Staff Editor
    This answer was written by one of our trained team of researchers who validated it for accuracy and comprehensiveness.
    How.com.vn English: How.com.vn Staff Editor
    How.com.vn Staff Editor
    Staff Answer
    When you find the angle between 2 vectors, the angle is always going to be between 0° and 180°.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      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]
        • 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().
      • For a quick plug and solve, use this formula for any pair of two-dimensional vectors: cosθ = (u1 • v1 + u2 • v2) / (√(u12 • u22) • √(v12 • v22)).
      • 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.
      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!
      Advertisement

      About This Article

      How.com.vn English: Grace Imson, MA
      Reviewed by:
      Math Teacher
      This article was reviewed by Grace Imson, MA and by How.com.vn staff writer, Devin McSween. Grace Imson is a math teacher with over 40 years of teaching experience. Grace is currently a math instructor at the City College of San Francisco and was previously in the Math Department at Saint Louis University. She has taught math at the elementary, middle, high school, and college levels. She has an MA in Education, specializing in Administration and Supervision from Saint Louis University. This article has been viewed 2,815,760 times.
      2 votes - 100%
      Co-authors: 41
      Updated: April 7, 2023
      Views: 2,815,760
      Article SummaryX

      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!

      Did this summary help you?

      Thanks to all authors for creating a page that has been read 2,815,760 times.

      Reader Success Stories

      • How.com.vn English: Lois Sparham

        Lois Sparham

        Jun 5, 2019

        "My A-level is in 2 hours, and I have never been able to do this topic until now! I owe How.com.vn. Big love to the..." more
        Rated this article:
      Share your story

      Did this article help you?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement