Advertisement

Angle between two vectors calculator

Enter two or three components per vector, use two directed endpoint pairs, or solve the magnitude-angle dot product identity.

Calculator

Angle between vectors
90
Dot product
0.0000000000
Magnitude of A
1.0000000000
Magnitude of B
1.0000000000

Advertisement

How this calculator works

The dot product measures how strongly two vectors align. Divide it by the product of their magnitudes to get the cosine of their angle, then use inverse cosine. Endpoint mode subtracts each starting point from its endpoint, preserving direction. The reported angle lies between 0 and 180 degrees. A zero vector has no defined direction. At a right angle, a zero dot product does not determine either vector's magnitude.

Formula

A dot B = sum(A_i B_i) = |A| |B| cos(theta). Thus theta = arccos((A dot B)/(|A| |B|)).

Worked example

A = (1, 0) and B = (0, 2) have dot product 0 and magnitudes 1 and 2, giving 90 degrees. Reversing the direction of (1, 2, 3) gives a vector at 180 degrees to it.

Advertisement

Frequently asked questions

Does the order of the vectors matter?

The unsigned angle is unchanged when A and B are swapped. This calculator does not choose a clockwise orientation in space.

Can vectors start at different points?

Yes. Their positions do not affect the angle between their directed displacements. Supply each start and end in the same coordinate system.

Why is a dot product outside the allowed range rejected?

The cosine must lie between -1 and 1. A larger absolute ratio cannot describe real vectors with the supplied magnitudes.

Sources

Advertisement