Skip to main content

Angle Between Two Vectors Calculator

Find the angle between two vectors with detailed steps.

Angle between vectors

Set unused components to 0. Both vectors must have at least one non-zero component.

How to Use

  1. Enter the components of vector A in the first row.
  2. Enter the components of vector B in the second row.
  3. Press Calculate to process the dot product and magnitudes.
  4. Review the angle in degrees and radians plus the computation steps.

Understanding Vector Angles

The angle between two vectors describes how far apart their directions are. It is measured by projecting one vector onto the other using the dot product formula.

Core relationship

A · B = |A| |B| cos(θ)

By isolating θ we use the inverse cosine of the normalized dot product.

Geometric Interpretation

The dot product captures how aligned two vectors are. When vectors point in the same direction the cosine approaches 1, and when they point in opposite directions the cosine approaches -1.

The cross product magnitude equals the area of the parallelogram spanned by the two vectors, which peaks when vectors are perpendicular.

Special cases

  • θ = 0° → vectors are parallel and point in the same direction.
  • θ = 90° → vectors are orthogonal (perpendicular).
  • θ = 180° → vectors are parallel but in opposite directions.

Applications

  • Computer graphics: shading and lighting calculations.
  • Physics: measuring work done by a force along a displacement.
  • Robotics: comparing orientation vectors.
  • Machine learning: cosine similarity for text and embeddings.
  • Navigation: analyzing relative directions between motion vectors.

Frequently Asked Questions

Can I leave the z component empty for 2D vectors?
Yes. Set the z component to 0 for both vectors and the calculator will treat them as 2D vectors embedded in 3D space.
Why do we clamp the cosine value between -1 and 1?
Floating-point rounding can push the computed cosine slightly outside the valid range. Clamping keeps arccosine stable and avoids NaN results.
What happens if one of the vectors is the zero vector?
The angle is undefined because the direction of the zero vector is indeterminate. The calculator blocks this input to keep the math valid.

Related Calculators

math
Angle Calculator

Convert angles and explore related properties.

math
Algebra Calculator

Solve linear and quadratic equations

math
Adjugate Matrix Calculator

Calculate adjugate matrix with steps