Angle Between Vectors Calculator
Find the angle between two 3D vectors from their dot product and magnitudes, in both degrees and radians.
How it works
cos θ = (a · b) / (|a| · |b|) · θ = arccos( cos θ )
The dot product of two vectors equals the product of their magnitudes times the cosine of the angle between them. Rearranging gives cos θ = (a·b)/(|a||b|), and taking the inverse cosine returns the angle in the range 0° to 180°. The cosine is clamped to [−1, 1] before the arccos so tiny floating-point overshoots never produce an invalid result.
Worked example
For a = (1, 0, 0) and b = (1, 1, 0): a·b = 1, |a| = 1, |b| = √2. So cos θ = 1/√2 ≈ 0.7071 and θ = arccos(0.7071) = 45°.
Sources: Dot product (Wikipedia)
Frequently asked questions
What angle means the vectors are perpendicular?
90°. That happens exactly when the dot product is zero, since cos 90° = 0. The calculator flags this case explicitly under "Relationship".
Why clamp the cosine to [−1, 1]?
Rounding error can make the computed ratio a hair above 1 or below −1 for parallel vectors. Feeding such a value to arccos would return NaN, so it is clamped back into the valid domain first.
Does the order of the vectors change the angle?
No. The dot product is symmetric, so the angle between a and b is the same as between b and a — always a value from 0° to 180°.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.