Calculateus

Angle Between Vectors Calculator

Calculate the angle between two 2D or 3D vectors using the dot product formula.

Result

Angle Between Vectors
53.13°
In Radians
0.9273 rad

Formula: θ = cos⁻¹((A·B) / (|A||B|)), derived from the dot product's geometric definition. A result of 90° means the vectors are perpendicular (dot product zero); 0° means they point in the same direction.

About the Angle Between Vectors Calculator

The Angle Between Vectors Calculator finds the angle formed where two vectors meet, whether you're working in a flat 2D plane or full 3D space. Enter the x, y, and (optionally) z components of two vectors and the tool returns the angle between them in both degrees and radians. It's built for students checking vector geometry homework, and for anyone in physics, engineering, or computer graphics who needs to know how two directions relate to each other.

How It Works

You supply the x and y components of Vector A and Vector B, with an optional z component for each if you're working in three dimensions (z defaults to 0 for a 2D problem). The calculator computes the dot product of the two vectors and divides it by the product of their magnitudes (lengths), which isolates the cosine of the angle between them. Taking the inverse cosine of that ratio converts it back into an actual angle, reported in both degrees and radians.

theta = cos^-1((A · B) / (|A||B|)), where A · B = x1x2 + y1y2 + z1z2 and |A| = sqrt(x1^2 + y1^2 + z1^2).

Formula & Methodology

To work this by hand, first compute the dot product by multiplying matching components and summing them. Next find each vector's magnitude by summing the squares of its components and taking the square root. Divide the dot product by the product of the two magnitudes to get cos(theta), then apply the inverse cosine function to read off the angle directly.

Examples

Two 2D Vectors

Vector A = (3, 4) and Vector B = (1, 0) give a dot product of 3, magnitudes of 5 and 1, and cos(theta) = 3/5, which works out to an angle of about 53.13 degrees (0.9273 radians).

A 3D Case

Vector A = (2, 3, 1) and Vector B = (-1, 4, 2) produce a dot product of 12, magnitudes of about 3.742 and 4.583, and an angle of roughly 45.58 degrees (0.7956 radians).

Advantages

  • Handles both 2D and 3D vectors in the same form, so you don't need a separate tool depending on how many components your problem has.
  • Returns the angle in both degrees and radians at once, matching whichever unit your coursework or software expects.
  • Clamps rounding errors internally so nearly parallel or nearly opposite vectors don't produce a computation error.

Common Mistakes

  • Forgetting to include the z component for a genuinely 3D problem, which silently reduces it to a 2D calculation since z defaults to 0.
  • Reading the result as a signed or directional angle when it's actually just the unsigned angle between the two directions, always between 0 and 180 degrees.
  • Mixing up which vector is A and which is B, though this doesn't affect the answer here since the formula is symmetric in A and B.

Edge Cases to Watch For

  • If either vector has zero length (all components zero), the calculator stops and returns an error, since direction is undefined for a zero vector.
  • Floating-point rounding can occasionally push the computed cosine value fractionally above 1 or below -1 for vectors that are exactly parallel or exactly opposite; the calculator clamps the ratio to the -1 to 1 range before taking the inverse cosine so this never produces an invalid result.
  • The angle returned is always between 0 and 180 degrees, since inverse cosine has no way to distinguish a clockwise turn from a counterclockwise one - it reports only the smaller angle between the two directions, not a signed rotation.
  • Leaving the z field at its default of 0 for both vectors effectively treats the problem as two dimensional.

Common Use Cases

  • Students verifying vector geometry or physics homework that asks for the angle between two force, velocity, or displacement vectors.
  • Engineers and programmers checking the orientation between two directions in a 3D graphics, robotics, or CAD calculation.
  • Anyone confirming whether two vectors are perpendicular, parallel, or opposite as a quick sanity check.
Written & fact-checked by the Calculateus TeamLast updated August 5, 2026How we verify our formulas

Frequently asked questions

How does this relate to the Dot Product Calculator?

This calculator uses the same dot product computation but carries it one step further, dividing by the product of the vectors' magnitudes and applying the inverse cosine to convert the result directly into an angle, rather than leaving it as a raw dot product value.

Conclusion

Because the calculation reduces to a single dot-product-over-magnitudes ratio, the tool gives an exact answer instantly rather than requiring a protractor or graph. Understanding the underlying formula also makes it easier to spot special cases, like a zero dot product signaling perpendicular vectors, when working through similar problems by hand.