rotvec
Convert quaternion to rotation vector (radians)
Description
converts the quaternion array,rotationVector
= rotvec(quat
)quat
, to anN3矩阵of equivalent rotation vectors in radians. The elements ofquat
are normalized before conversion.
Examples
Input Arguments
Output Arguments
Algorithms
All rotations in 3-D can be represented by a three-element axis of rotation and a rotation angle, for a total of four elements. If the rotation axis is constrained to be unit length, the rotation angle can be distributed over the vector elements to reduce the representation to three elements.
Recall that a quaternion can be represented in axis-angle form
whereθis the angle of rotation and [x,y,z] represent the axis of rotation.
Given a quaternion of the form
you can solve for the rotation angle using the axis-angle form of quaternions:
Assuming a normalized axis, you can rewrite the quaternion as a rotation vector without loss of information by distributingθover the partsb,c, andd. The rotation vector representation ofqis