pymel.core.datatypes.angle

angle(a, b, c=None)

angle(u, v) –> float

Returns the angle of rotation between u and v. u and v should be 3 dimensional Vectors representing 3D vectors.

Note: this angle is not signed, use axis to know the direction of the rotation.

>>> u = VectorN(1.0, 0.0, 0.0)
>>> v = VectorN(0.707, 0.0, -0.707)
>>> print round(angle(u, v), 7)
0.7853982
>>> print round(angle(u, [0.707, 0.0, -0.707]), 7)
0.7853982

Alternatively can use the form angle(a, b, c), where a, b, c are 4 dimensional Vectors representing 3D points, it is then equivalent to angle(b-a, c-a)

>>> o = VectorN(0.0, 1.0, 0.0, 1.0)
>>> p = VectorN(1.0, 1.0, 0.0, 1.0)
>>> q = VectorN(0.707, 1.0, -0.707, 1.0)
>>> print round(angle(o, p, q), 7)
0.7853982

Related : see VectorN.angle method.