Angle Between Two Vectors (2D) Formula
This formula calculates the signed angle between two vectors in two-dimensions. To calculate the unsigned angle between two vectors of arbitrary degree, see this formula.
Expression | Description |
---|---|
The angle between the two vectors. | |
The extended arc tangent function. | |
The first vector. | |
The second vector. |
This formula calculates the signed angle between two vectors in two-dimensions. For example, given the vectors and the angle is calculated as:
Geometrically, this can be interpreted as the angle that rotates to in the counter-clockwise (positive) direction.
If we change to be somewhere in the shaded region, as shown below, then the formula returns the angle that rotates to in the clockwise (negative) direction.
This formula calculates the signed angle between two vectors in two-dimensions using the extended arc tangent function. Geometrically, the signed angle represents the smallest possible rotation from to . In the example below, the calculated angle is negative because the shortest rotation occurs in the clockwise (negative) direction.
We can visualize when the angle will be positive or negative if we fix in place and divide the space into two regions on either side of . When lies in the region located in the counter-clockwise direction of , the angle is positive. When lies in the region clockwise to , the angle is negative.
There is another formula that calculates the unsigned angle between two vectors using the arc cosine function. This formula returns the smallest positive angle between two vectors.
If you compare the output of the formula on this page with the arc cosine formula, the difference can be seen in the shaded region, where the arc cosine formula returns the smallest positive angle between the two vectors.
In other word, the arc cosine formula returns unsigned angles in the range to and the formula on this page returns signed angles in the range to .
To calculate the unsigned angle between two vectors of arbitrary degree you can use the arc cosine function. This formula calculates angles between negative 90 degrees and positive 90 degrees.