skrobot.coordinates.math.rodrigues¶
- skrobot.coordinates.math.rodrigues(axis, theta=None)[source]¶
Rodrigues formula.
See: Rodrigues’ rotation formula - Wikipedia.
See: Axis-angle representation - Wikipedia.
- Parameters:
axis (numpy.ndarray or list) – [x, y, z] vector. You can give axis-angle representation to axis if theta is None.
theta (float or None (optional)) – radian. If None is given, calculate theta from axis.
- Returns:
mat – 3x3 rotation matrix
- Return type:
Examples
>>> import numpy >>> from skrobot.coordinates.math import rodrigues >>> rodrigues([1, 0, 0], 0) array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]) >>> rodrigues([1, 1, 1], numpy.pi) array([[-0.33333333, 0.66666667, 0.66666667], [ 0.66666667, -0.33333333, 0.66666667], [ 0.66666667, 0.66666667, -0.33333333]])