m3sh.linalg.

angle#

angle(u, v, up=None, degrees=False)#

Angle between vectors.

Angle between vectors u and v in radians. To obtain an oriented angle the up vector has to be specified. If specified, up must not be contained in the span of u and v.

Parameters:
u, vndarray, shape (3,)

Non-zero vectors in 3-space.

upndarray, shape (3,), optional

Non-zero vector in 3-space. Does not have to be of unit length.

degreesbool, optional

Convert result from radians to degrees.

Returns:
anglefloat

Angle in radians in the range \([0, \pi]\) if up is not specified, otherwise in \([-\pi, \pi]\).

Notes

If the up vector is defined the sign of the angle is determined via the right-hand rule, i.e., it is positive if the cross product of u and v (in this order) points in the same direction as up.