Angle Between Two Vectors (Unsigned) Formula

Angle Between Two Vectors (Unsigned) Formula

Formula

Summary

The unsigned angle between two vectors is given by the arc cosine of the result from dividing their dot product by the product of their magnitudes.

Expression Description
The angle between the two vectors.
The arc cosine function.
The first vector.
The second vector.

How to use

This formula calculates the unsigned angle between two vectors using the arc cosine function. For example, the angle between the vectors and is calculated as:

We can visualize the angle between these two vectors like this.

Unsigned angle example.

The angle returned from this formula is always positive. We can visualize the angles calculated by keeping in place and visualizing different positions for like this.

Unsigned angles between vectors.

The angle returned is unsigned, because it doesn’t describe how to get from the first vector to the second vector. In fact, the order of the vectors doesn’t matter. If you swap with , the formula produces the same positive angle. To calculate the signed angle between vectors in two dimensions, see this formula.

The advantage of the formula on this page versus the signed version is that it works for higher dimensions.

Related Formulas

Angle Between Two Vectors (2D)

To calculate the signed angle between two vectors you can use the extended arc tangent function. This formula calculates angles between negative 180 degrees and positive 180 degrees.

Dot Product

The dot product of two vectors is calculated by summing together the product of corresponding elements.

Magnitude of Vector

The magnitude of a vector is given by the square root of the sum of its components squared.