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
- Enter the x and y components of vector a.
- 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.