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 โˆš(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.
Method 1
Method 1 of 3:

Using the Dot Product Formula

  1. ( โ€ข ) / ( || || || || ). The angle between 2 vectors is where the tails of 2 vectors, or line segments, meet. [1] 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: [2]
    • 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. 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. [3]
    • 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
  3. 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. [4]
    • 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.
    • 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.
  4. 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. [5]
    • 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 ...

  5. Remember, the formula is ( โ€ข ) / ( || || || || ) Now that you know both the dot product and the magnitudes of each vector, simply enter them into this formula. [6]

    Finding Cosine with Dot Product and Magnitude
    In our example, ฮธ = cos -1 6 / ( 2โˆš2 โ€ข 3 ). Simplify to get ฮธ = cos -1 (โˆš2 / 2).

  6. 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. ( ) / ( || || || || ). 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: [7]
    • 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. 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. [8]
    • 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>
  3. 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. [9] Just plug in the i, k, j coordinates of the cross product of the vectors to get their magnitude. [10]
    • 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
  4. Now, calculate the magnitude of each vector using their dimensional coordinates. [11] Just plug the coordinates into the Pythagorean Theorem like in the step above. [12]
    • 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
  5. Now that you have the vectorsโ€™ cross product and magnitudes, simply enter them into the formula ( ) / ( || || || || ). [13]
    • In our example, ฮธ = sin -1 (โˆš1539 / โˆš14 * โˆš110)
  6. 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. [14]
    • 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. 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. 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. [15]
  3. 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 = - . [16]
  4. Insert the length of the "vector triangle" sides in our example into the Law of Cosines: [17]
    • || (a - b) || 2 = || a || 2 + || b || 2 - 2 || a || || b || cos (ฮธ)
  5. 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: [18]
    • ( - ) โ€ข ( - ) = โ€ข + โ€ข - 2 || a || || b || cos (ฮธ)
  6. Expand the left side of the formula, then simplify to reach the formula used to find angles. [19]
    • โ€ข - โ€ข - โ€ข + โ€ข = โ€ข + โ€ข - 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?
    wikiHow Staff Editor
    Staff Answer
    This answer was written by one of our trained team of researchers who validated it for accuracy and comprehensiveness.
    wikiHow 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ยฐ ?
    wikiHow Staff Editor
    Staff Answer
    This answer was written by one of our trained team of researchers who validated it for accuracy and comprehensiveness.
    wikiHow 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?
    wikiHow Staff Editor
    Staff Answer
    This answer was written by one of our trained team of researchers who validated it for accuracy and comprehensiveness.
    wikiHow 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
      Advertisement

      Video

      Tips

      • 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 )).
      • 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:
        • 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( โ€ข ).
      • 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
      Name
      Please provide your name and last initial
      Thanks for submitting a tip for review!
      Advertisement

      About This Article

      Article Summary X

      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,882,243 times.

      Reader Success Stories

      • 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 wikiHow. Big love to the ..." more
        Rated this article:
      Share your story

      Did this article help you?

      Advertisement