| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Aerospace Blockset |
| Contents | Index |
| Learn more about Aerospace Blockset |
Utilities/Axes Transformations

The Quaternions to Direction Cosine Matrix block transforms the four-element unit quaternion vector (q0, q1, q2, q3) into a 3-by-3 direction cosine matrix (DCM). The outputted DCM performs the coordinate transformation of a vector in inertial axes to a vector in body axes.
Using quaternion algebra, if a point P is subject to the rotation described by a quaternion q, it changes to P′ given by the following relationship:

Expanding P′ and collecting terms in x, y, and z gives the following for P' in terms of P in the vector quaternion format:
![]()

Since individual terms in P′ are linear combinations of terms in x, y, and z, a matrix relationship to rotate the vector (x, y, z) to (x′, y′, z′) can be extracted from the preceding. This matrix rotates a vector in inertial axes, and hence is transposed to generate the DCM that performs the coordinate transformation of a vector in inertial axes into body axes.


| Input | Dimension Type | Description |
|---|---|---|
First | 4-by-1 quaternion vector | Contains the quaternion vector. |
| Output | Dimension Type | Description |
|---|---|---|
First | 3-by-3 direction cosine matrix. | Contains the direction cosine matrix. |
Direction Cosine Matrix to Rotation Angles
Direction Cosine Matrix to Quaternions
Rotation Angles to Direction Cosine Matrix
Rotation Angles to Quaternions
![]() | Quaternion Rotation | Quaternions to Rotation Angles | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |