You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
The class RotationMatrix allows to handle a 3D rotation matrix with different parametrizations:
- a [3x3] rotation matrix
- Euler angles
- exponential map
- quaternions
Once a RotationMatrix instance has been created from one of the parametrizations above,
all the parametrizations can be obtained interchangeably.
Additional static methods allow to convert a parametrization into another one without creating instances.
Examples:
% create a RotationMatrix from different parametrizations
r = RotationMatrix(rand([3,1]), 'exponentialMap');
r = RotationMatrix(eye(3), 'rotationMatrix');
r = RotationMatrix(rand([4,1]), 'quaternion');
r = RotationMatrix(rand([3,1]), 'eulerAngles');
% get a particular representation of a RotationMatrix
aMatrix = r.GetRotationMatrix();
aQuaternion = r.GetQuaternion();
eulerAngles = r.GetEulerAngles();
anExponentialMap = r.GetExponentialMap();
% use static methods for creating 3x3 rotation matrices:
rotationMatrix = RotationMatrix.ComputeRotationMatrixFromQuaternion(rand(4,1))
rotationMatrix = RotationMatrix.ComputeRotationMatrixFromEulerAngles(rand(), rand(), rand());
rotationMatrix = RotationMatrix.ComputeRotationMatrixFromExponentialMap(rand(3,1))
% See RotationMatrixTest.m for further examples.
Cite As
AlbeCrive (2026). Rotation Matrix 3D (https://www.mathworks.com/matlabcentral/fileexchange/46419-rotation-matrix-3d), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.2.0.0 (3.82 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
