skrobot.coordinates.math.axis_angle_from_matrix

skrobot.coordinates.math.axis_angle_from_matrix(rotation)[source]

Converts the rotation of a matrix into axis-angle representation.

Parameters:

rotation (numpy.ndarray) – 3x3 rotation matrix

Returns:

axis_angle – axis-angle representation of vector

Return type:

numpy.ndarray

Examples

>>> import numpy
>>> from skrobot.coordinates.math import axis_angle_from_matrix
>>> axis_angle_from_matrix(numpy.eye(3))
array([0, 0, 0])
>>> axis_angle_from_matrix(
    numpy.array([[0, 0, 1], [0, 1, 0], [-1, 0, 0]]))
array([0.        , 1.57079633, 0.        ])