Recommended inputs: components of vector A and vector B, with matching dimensions. Recommended outputs: dot product, magnitude of each vector, cosine value, and angle in degrees and radians.
What Is the Angle Between Two Vectors?
The angle between two vectors is the smaller angle formed when the vectors are placed tail to tail. It describes how the vectors point relative to one another. The angle can range from 0° to 180°, or from 0 to π radians.
An angle of 0° means the vectors point in the same direction. An angle of 90° means they are perpendicular. An angle of 180° means they point in opposite directions.
Angle Between Two Vectors Formula
The standard method uses the dot product of the vectors and their magnitudes:
Here, A · B is the dot product, while |A| and |B| are the magnitudes (lengths) of the vectors. The inverse cosine function, written as cos⁻¹ or arccos, converts the cosine value into an angle.
Dot product for vector components
For two 2D vectors A = (a₁, a₂) and B = (b₁, b₂):
For 3D vectors A = (a₁, a₂, a₃) and B = (b₁, b₂, b₃):
The magnitude of a 2D vector A = (a₁, a₂) is √(a₁² + a₂²). For a 3D vector, include the third component under the square root: √(a₁² + a₂² + a₃²).
How to Find the Angle Between Two Vectors
- Find the dot product. Multiply matching vector components and add the products.
- Calculate each magnitude. Square each component, add the squares, and take the square root.
- Divide the dot product by the product of the magnitudes. This gives the cosine of the angle.
- Apply inverse cosine. Use arccos or cos⁻¹ to obtain the angle.
- Choose the unit. Report the answer in degrees or radians as required.
Example: Find the Angle Between Two 2D Vectors
Find the angle between A = (1, 0) and B = (1, 1).
Step 1: Calculate the dot product
Step 2: Find the magnitudes
Step 3: Apply the formula
Therefore, the angle between the vectors is 45 degrees, or π/4 radians.
Common Angles Between Vectors
| Relationship | Dot product | Angle |
|---|---|---|
| Same direction (nonzero vectors) | Positive, with cosine 1 | 0° or 0 radians |
| Perpendicular vectors | 0 | 90° or π/2 radians |
| Opposite directions | Negative, with cosine −1 | 180° or π radians |
Angle Between Two Vectors in 3D
The same dot product formula works for vectors in three dimensions. For A = (a₁, a₂, a₃) and B = (b₁, b₂, b₃), calculate:
Make sure both vectors have the same number of components. The formula can also be extended to vectors in higher-dimensional spaces.
Degrees vs. Radians
Degrees and radians are two ways to express the same angle. A full turn is 360° or 2π radians, and a right angle is 90° or π/2 radians.
- Degrees: Often used in geometry and introductory problems.
- Radians: Common in calculus, trigonometry, and programming.
To convert radians to degrees, multiply by 180/π. To convert degrees to radians, multiply by π/180. Check the calculator’s angle mode before interpreting the result.
What Does the Dot Product Tell You?
The dot product indicates whether the angle is acute, right, or obtuse for nonzero vectors:
- Positive dot product: The angle is less than 90°.
- Zero dot product: The vectors are perpendicular, so the angle is 90°.
- Negative dot product: The angle is greater than 90°.
Common Mistakes to Avoid
- Using mismatched dimensions: Both vectors must have the same number of components.
- Forgetting vector magnitudes: The dot product alone does not give the angle.
- Using cosine instead of inverse cosine: After finding the cosine ratio, apply arccos to obtain the angle.
- Mixing degrees and radians: Confirm the unit used by your calculator or assignment.
- Entering a zero vector: The angle is undefined if either vector has zero magnitude.
- Rounding too early: Keep precision through the intermediate steps and round the final angle.
Frequently Asked Questions
What is the formula for the angle between two vectors?
Use θ = cos⁻¹[(A · B) ÷ (|A||B|)], where A · B is the dot product and |A| and |B| are the vector magnitudes.
Can I find the angle between vectors in 2D and 3D?
Yes. The dot product formula works for 2D, 3D, and higher-dimensional vectors, provided both vectors have the same dimension and neither is a zero vector.
How do I know if two vectors are perpendicular?
For nonzero vectors, their dot product is zero if they are perpendicular. Their angle is then 90° or π/2 radians.
Can the angle between two vectors be greater than 180 degrees?
The standard angle returned by the dot product formula is between 0° and 180° inclusive. It gives the smaller, unsigned angle between the vector directions.
Why is the angle undefined for a zero vector?
A zero vector has magnitude zero, so the denominator in the formula is zero. The angle cannot be calculated using this formula.
What is the angle between vectors (1, 0) and (0, 1)?
The dot product is 1 × 0 + 0 × 1 = 0. Since both vectors are nonzero and their dot product is zero, the angle is 90° or π/2 radians.
Does the order of the vectors change the angle?
No. The dot product is commutative, so swapping the two vectors does not change the standard angle between them.