rotvec
Description
converts the quaternion array, rotationVector
= rotvec(quat
)quat
, to an
N-by-3 matrix of equivalent rotation vectors in radians. The
elements of quat
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 parts b, c, and d. The rotation vector representation of q is
Extended Capabilities
Version History
Introduced in R2021a