Math

Angle Between Two Vectors Calculator

Find the angle between two vectors from their components.


Angle Between Two Vectors Calculator

Advertisement

Find the angle separating two vectors, from their x and y components.

How it works

The formula uses the dot product: θ = arccos((a · b) ÷ (|a| × |b|)). The vectors (1, 0) and (0, 1) — pointing along the two axes — are exactly 90° apart.

What this does not include

This is distinct from this site’s vector magnitude calculator, which reports a single vector’s length rather than the angle between two vectors.

How to use this calculator

  1. Enter the x and y components of vector a.
  2. Enter the x and y components of vector b.

A worked example

Vectors (1, 0) and (0, 1): angle between them = 90° — the standard x and y axes are perpendicular.

Vectors (1, 1) and (1, 0): angle = 45°.

What the variables mean

Variable Meaning
Vector A (ax, ay) First vector’s components
Vector B (bx, by) Second vector’s components

Edge cases worth knowing

A zero-length vector makes the angle undefined — direction isn’t meaningful for a vector with no magnitude, so the calculator declines to show a result.

This uses the dot product internally — the same underlying formula this site’s dot product calculator computes, just solved for the angle instead of the raw scalar.

What does an angle of 0° mean?

The two vectors point in exactly the same direction, even if they have different magnitudes.

What does an angle of 180° mean?

The two vectors point in exactly opposite directions.

Why does the dot product show up in this formula?

The dot product’s geometric definition is |a||b|cos(θ), so dividing it by the two magnitudes and taking the inverse cosine directly recovers the angle between them.

Be the first to rate this

Written by

J. Adeyemi

Statistics writer

J. Adeyemi writes the statistics and probability calculators, from descriptive summaries through to distributions and conditional probability. The recurring theme is scope: each page states precisely which question it answers, because most statistical mistakes come from applying a correct formula to the wrong question. Related-but-different measures get separate pages rather than being quietly merged.

Reviewed by

T. Okafor

Calculator reviewer — mathematics

T. Okafor reviews the mathematics calculators, verifying algebraic correctness and, just as importantly, behaviour at the edges — division by zero, undefined results, and the floating-point cases where a formula technically returns a number that should be reported as undefined. Every test case is recomputed independently rather than taken on trust.

How we write and review

Related calculators