skrobot.coordinates.math.inverse_rodrigues

skrobot.coordinates.math.inverse_rodrigues(mat)[source]

Inverse Rodrigues formula Convert Rotation-Matirx to Axis-Angle.

Return theta and axis. If given unit matrix, return None.

Parameters:

mat (numpy.ndarray) – rotation matrix, shape (3, 3)

Returns:

theta, axis – rotation angle in radian and rotation axis

Return type:

tuple(float, numpy.ndarray)

Examples

>>> import numpy
>>> from skrobot.coordinates.math import rotation_angle
>>> rotation_angle(numpy.eye(3)) is None
True
>>> rotation_angle(numpy.array([[0, 0, 1], [0, 1, 0], [-1, 0, 0]]))
(1.5707963267948966, array([0., 1., 0.]))