Angle Between Vectors Calculator
Find the angle between two 2D or 3D vectors in degrees and radians using the dot product formula.
Formula: θ = acos((a · b) / (|a| |b|)) — the dot product divided by the product of the magnitudes gives cos θ; taking the inverse cosine yields the angle in the range [0°, 180°].
How it works
- 1Enter the components of Vector a and Vector b — switch between 2D and 3D with the dimension tabs.
- 2The calculator computes the dot product a · b and both magnitudes |a| and |b|, then evaluates θ = acos((a · b) / (|a| |b|)).
- 3The angle is displayed in degrees (0°–180°) and in radians so you can use the result directly in code or further calculations.
Use cases
- Computer graphics — determining the angle of incidence between a light direction and a surface normal for shading calculations.
- Physics — finding the angle between a force vector and a displacement vector to compute work done (W = F · d · cos θ).
- Machine learning — measuring the cosine similarity between two feature vectors to assess their directional relationship.
Frequently asked questions
What does an angle of 0° or 180° mean?
0° means the vectors point in exactly the same direction (they are parallel and co-directional). 180° means they point in exactly opposite directions. 90° means they are perpendicular — their dot product is zero.
Why does the calculator return — for a zero vector?
A zero vector has no direction, so the angle between it and any other vector is undefined. The formula requires dividing by the magnitudes |a| and |b|, and |0| = 0 makes that undefined.
Does the order of the vectors matter?
No. The angle between a and b equals the angle between b and a because the dot product is commutative: a · b = b · a. The result is always the same positive angle in [0°, 180°].
Related tools
See all →Calculate the area and perimeter of a rectangle from its width and height, with a labeled diagram.
Calculate the area and circumference of a circle from its radius, with a labeled diagram.
Calculate the area (Heron’s formula) and perimeter of a triangle from its three sides.
Calculate the area and perimeter of a trapezoid from its two parallel sides, height, and legs.