pytransform3d.rotations.norm_angle#

pytransform3d.rotations.norm_angle(a)[source]#

Normalize angle to (-pi, pi].

It is worth noting that using numpy.ceil to normalize angles will lose more digits of precision as angles going larger but can keep more digits of precision when angles are around zero. In common use cases, for example, -10.0*pi to 10.0*pi, it performs well.

For more discussions on numerical precision: dfki-ric/pytransform3d#263

Parameters:
afloat or array-like, shape (n,)

Angle(s) in radians

Returns:
a_normfloat or array, shape (n,)

Normalized angle(s) in radians