WOLFRAM

gives the angle between the vectors u and v.

Details

  • VectorAngle gives an angle in radians.
  • For nonzero real vectors the vector angle satisfies .
  • For complex vectors the numerator is .

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

The angle between two vectors in 2D:

Out[1]=1
Out[2]=2

The angle between two vectors in 3D:

Out[3]=3
Out[4]=4

The angle between orthogonal vectors:

Out[1]=1
Out[2]=2
Out[3]=3

Scope  (2)Survey of the scope of standard use cases

Use exact arithmetic to compute the vector angle:

Out[2]=2

Use machine arithmetic:

Out[3]=3

Use 47-digit precision arithmetic:

Out[4]=4

Use symbolic vectors:

Out[1]=1
Out[2]=2
Out[3]=3

Generalizations & Extensions  (1)Generalized and extended use cases

For complex vectors, the angle returned may be complex:

Out[1]=1

Applications  (3)Sample problems that can be solved with this function

Find when two vectors have the same direction:

Out[2]=2
Out[3]=3

Find the area of the triangle, with u and v as two sides:

Out[2]=2

Plot the area in the triangle formed by the axis and a unit vector in the first quadrant:

Out[3]=3

Distribution of angles between random vectors with positive entries in 2, 3, 5, and 10 dimensions:

Out[1]=1

Properties & Relations  (6)Properties of the function, and connections to other functions

The vector angle satisfies :

Out[2]=2
Out[3]=3

The generalization to complex vectors satisfies :

Out[2]=2
Out[3]=3

If you rotate a vector u in a plane that includes u, then the vector angle is the rotation angle:

Out[2]=2
Out[3]=3

If you rotate it in a plane that does not include u, then the angles differ:

Out[4]=4
Out[5]=5

The vector angle is related to the cross product through :

Out[1]=1
Out[2]=2
Out[3]=3

ArcTan of two arguments gives the signed vector angle between the axis and the vector:

Out[2]=2
Out[3]=3
Out[4]=4

Eigenvectors are the vectors for which the angle between and is 0:

Out[3]=3
Out[4]=4
Out[5]=5
Out[6]=6

Possible Issues  (1)Common pitfalls and unexpected behavior

The angle between the zero vector and any other vector is indeterminate:

Out[1]=1
Wolfram Research (2007), VectorAngle, Wolfram Language function, https://reference.wolfram.com/language/ref/VectorAngle.html.
Wolfram Research (2007), VectorAngle, Wolfram Language function, https://reference.wolfram.com/language/ref/VectorAngle.html.

Text

Wolfram Research (2007), VectorAngle, Wolfram Language function, https://reference.wolfram.com/language/ref/VectorAngle.html.

Wolfram Research (2007), VectorAngle, Wolfram Language function, https://reference.wolfram.com/language/ref/VectorAngle.html.

CMS

Wolfram Language. 2007. "VectorAngle." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/VectorAngle.html.

Wolfram Language. 2007. "VectorAngle." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/VectorAngle.html.

APA

Wolfram Language. (2007). VectorAngle. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VectorAngle.html

Wolfram Language. (2007). VectorAngle. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/VectorAngle.html

BibTeX

@misc{reference.wolfram_2025_vectorangle, author="Wolfram Research", title="{VectorAngle}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/VectorAngle.html}", note=[Accessed: 29-March-2025 ]}

@misc{reference.wolfram_2025_vectorangle, author="Wolfram Research", title="{VectorAngle}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/VectorAngle.html}", note=[Accessed: 29-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_vectorangle, organization={Wolfram Research}, title={VectorAngle}, year={2007}, url={https://reference.wolfram.com/language/ref/VectorAngle.html}, note=[Accessed: 29-March-2025 ]}

@online{reference.wolfram_2025_vectorangle, organization={Wolfram Research}, title={VectorAngle}, year={2007}, url={https://reference.wolfram.com/language/ref/VectorAngle.html}, note=[Accessed: 29-March-2025 ]}