skrobot.coordinates.math.axis_angle_vector_to_rotation_matrix
- skrobot.coordinates.math.axis_angle_vector_to_rotation_matrix(omega, p=1.0)[source]
Convert axis-angle vector representation to rotation matrix.
Converts an axis-angle representation (where the vector direction is the rotation axis and magnitude is the rotation angle) to a rotation matrix using Rodrigues’ formula.
- Parameters:
omega (list or numpy.ndarray) – Axis-angle vector of shape (3,). The direction represents the rotation axis and the magnitude represents the rotation angle in radians.
p (float, optional) – Interpolation parameter (default: 1.0). When p=1.0, returns the full rotation. When 0<p<1, returns partial rotation.
- Returns:
rot – 3x3 rotation matrix
- Return type:
Examples
>>> import numpy as np >>> from skrobot.coordinates.math import axis_angle_vector_to_rotation_matrix >>> axis_angle_vector_to_rotation_matrix([1, 1, 1]) array([[ 0.22629564, -0.18300792, 0.95671228], [ 0.95671228, 0.22629564, -0.18300792], [-0.18300792, 0.95671228, 0.22629564]]) >>> axis_angle_vector_to_rotation_matrix([1, 0, 0]) array([[ 1. , 0. , 0. ], [ 0. , 0.54030231, -0.84147098], [ 0. , 0.84147098, 0.54030231]])