Convert 3-D rotation matrix to rotation vector
returns an axis-angle rotation vector that corresponds to the input 3-D rotation matrix. The
function uses the Rodrigues formula for the conversion.
rotationVector = rotmat2vec3d(
Convert Rotation Matrix to Rotation Vector
Create a matrix representing a 90-degree rotation about the Z axis.
rotationMatrix = [0 -1 0; 1 0 0; 0 0 1];
Find the equivalent rotation vector.
rotationVector = rotmat2vec3d(rotationMatrix)
rotationVector = 1×3 0 0 1.5708
rotationMatrix — Rotation of camera
Rotation of camera, specified as a 3-by-3 matrix. You can obtain this matrix by
rotationVector — Rotation vector
Rotation vector, returned as a three-element vector. The vector represents the axis of rotation in 3-D, where the magnitude corresponds to the rotation angle in radians.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version HistoryIntroduced in R2022b
R2022b: Recommended over
Starting in R2022b, most Computer Vision Toolbox™ functions create and perform geometric transformations using the premultiply
convention. However, the
rotationMatrixToVector function uses the
postmultiply convention. Although there are no plans to remove
rotationMatrixToVector at this time, you can streamline your
geometric transformation workflows by switching to the
function, which supports the premultiply convention. For more information, see Migrate Geometric Transformations to Premultiply Convention.