1. What a Direction Cosine Matrix Is
The output parameters of a navigation system, such as position, velocity and attitude, are all relative to some coordinate system. Many coordinate systems are used in navigation, and different navigation systems often adopt different navigation coordinate systems, so the question is how to transform between them. The direction cosine matrix and the quaternion are the two tools used for this transformation. The direction cosine matrix, usually abbreviated as DCM, is one of the most important matrices in navigation systems. It converts the components of a vector expressed in one coordinate system into the components of the same vector expressed in another coordinate system, and in doing so it also carries the rotation of the second coordinate system relative to the original one. In this way the vector in the original coordinate system and the vector in the second coordinate system are related quantitatively.
The same idea can be stated from the projection of a vector. When a coordinate system \(O-X_1Y_1Z_1\) is rotated by an angle \(\alpha\) about the axis \(OZ_1\) and becomes the coordinate system \(O-X_2Y_2Z_2\), a space vector \(r\) has the projection \([r_{x1}\ r_{y1}\ r_{z1}]^{\mathrm T}\) in \(O-X_1Y_1Z_1\) and the projection \([r_{x2}\ r_{y2}\ r_{z2}]^{\mathrm T}\) in \(O-X_2Y_2Z_2\). The relation between the two sets of coordinates can be derived from the geometry of the rotation. Since the rotation axis is \(OZ_1\), the \(Z\) coordinate does not change, so
\[ r_{z2}=r_{z1} \]
From the geometry of the rotation,
\[ r_{x2}=OA+AB+BC=OD\cos\alpha+BD\sin\alpha+BF\sin\alpha=r_{x1}\cos\alpha+r_{y1}\sin\alpha \]
\[ r_{y2}=DE-AD=DF\cos\alpha-OD\sin\alpha=r_{y1}\cos\alpha-r_{x1}\sin\alpha \]
\[ r_{z2}=r_{z1} \]
Written in matrix form, these three relations become
\[ \begin{bmatrix} r_{x2} \\ r_{y2} \\ r_{z2} \end{bmatrix} = \begin{bmatrix} \cos\alpha & \sin\alpha & 0 \\ -\sin\alpha & \cos\alpha & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} r_{x1} \\ r_{y1} \\ r_{z1} \end{bmatrix} \qquad (1) \]
With the notation
\[ r^1=\begin{bmatrix} r_{x1} \\ r_{y1} \\ r_{z1} \end{bmatrix},\quad r^2=\begin{bmatrix} r_{x2} \\ r_{y2} \\ r_{z2} \end{bmatrix},\quad C_1^2=\begin{bmatrix} \cos\alpha & \sin\alpha & 0 \\ -\sin\alpha & \cos\alpha & 0 \\ 0 & 0 & 1 \end{bmatrix} \]
equation (1) can be written as
\[ r^2=C_1^2 r^1 \]
This equation describes the transformation relation between the projections of the same vector in different coordinate systems. The matrix \(C_1^2\) is called the transformation matrix from coordinate system 1 to coordinate system 2. On inspection, the elements of \(C_1^2\) are the projections of the unit vectors on the axes of coordinate system 1 onto the axes of coordinate system 2.
2. Why Two Coordinate Systems Are Needed
To determine the angular position of a rigid body rotating about a fixed point in space, two sets of coordinate systems must be introduced. One set represents the selected reference space, such as inertial space, the local horizontal reference or the base of an instrument, and is called the reference coordinate system. The other set represents the rotating rigid body under study, such as a gyro rotor, a gimbal or a platform body, and is called the moving coordinate system. The angular position of the moving coordinate system relative to the reference coordinate system is usually described by the direction cosine method or by the Euler angle method.
In a planar example (Figure 1), a point \(M\) has coordinates \((X_0,Y_0)\) in the coordinate system \(OXY\) and coordinates \((x,y)\) in the coordinate system \(Oxy\). If the two systems coincide at the beginning and the point \(M\) remains fixed, the coordinates of \(M\) in both systems do not change. When \(Oxy\) rotates about the fixed point \(O\) to some position in space, the coordinates \((x,y)\) of \(M\) in \(Oxy\) change. Let \(i_1,i_2\) be the unit vectors of \(OXY\) and \(e_1,e_2\) the unit vectors of \(Oxy\). The rotation of \(Oxy\) about \(O\) is also the rotation of the unit vectors \(e_1,e_2\).
When \(e_1,e_2\) rotate counterclockwise through an angle \(\theta\) relative to \(i_1,i_2\),
\[ e_1=i_1\cos\theta+i_2\sin\theta \] \[ e_2=-i_1\sin\theta+i_2\cos\theta \]
Thus one set of unit vectors can be expressed linearly in terms of the other set. In matrix form,
\[ [e_1\ e_2]=[i_1\ i_2]\begin{bmatrix}\cos\theta & -\sin\theta \\ \sin\theta & \cos\theta\end{bmatrix}=[i_1\ i_2]A^{\mathrm T} \qquad (2) \]
or
\[ \begin{bmatrix}e_1\\e_2\end{bmatrix}=A\begin{bmatrix}i_1\\i_2\end{bmatrix} \]
where
\[ A=\begin{bmatrix}\cos\theta & \sin\theta \\ -\sin\theta & \cos\theta\end{bmatrix}=\begin{bmatrix}C_{11} & C_{12} \\ C_{21} & C_{22}\end{bmatrix} \]
is called the transition matrix from the unit vectors (basis vectors \(i_1,i_2\)) to \((e_1,e_2)\). The corresponding coordinate transformation is
\[ \begin{bmatrix}x\\y\end{bmatrix}=A\begin{bmatrix}X_0\\Y_0\end{bmatrix} \qquad (3) \]

3. Two Proofs of the Same Matrix
The same two-dimensional result can be proved in two ways (Figure 2). In the first proof, consider a vector \(r\) that is represented as \(r^x\) in the \(x\) coordinate system. The \(y\) coordinate system is rotated by an angle \(\psi\) relative to the \(x\) coordinate system, and the length of the vector does not change, so the vector is represented as \(r^y\) in the \(y\) coordinate system. The task is to determine the coordinate components of this vector in the rotated \(y\) coordinate system. From the simple geometric relations in the figure,
\[ y_1=\cos\psi\,x_1+\sin\psi\,x_2 \qquad (4) \] \[ y_2=-\sin\psi\,x_1+\cos\psi\,x_2 \]
In the second proof, let the angle between \(r\) and \(x_1\) be \(\theta\). Then
\[ x_1=r\cos\theta,\quad x_2=r\sin\theta \qquad (5) \]
Let the angle between \(y_1\) and \(x_1\) be \(\psi\). Then
\[ y_1=r\cos(\theta-\psi)=r\cos\theta\cos\psi+r\sin\theta\sin\psi \qquad (6) \] \[ y_2=r\sin(\theta-\psi)=r\sin\theta\cos\psi-r\cos\theta\sin\psi \]
Substituting equation (5) into equation (6) gives
\[ y_1=\cos\psi\,x_1+\sin\psi\,x_2 \qquad (7) \] \[ y_2=-\sin\psi\,x_1+\cos\psi\,x_2 \]
Written in vector form, equation (7) becomes
\[ y=C_x^y x \qquad (8) \]
where the transformation matrix \(C_x^y\) is
\[ C_x^y=\begin{bmatrix}\cos\psi & \sin\psi \\ -\sin\psi & \cos\psi\end{bmatrix} \qquad (9) \]
This matrix connects the components in the \(x\) coordinate system with the components in the \(y\) coordinate system, and it is the direction cosine matrix.

4. Direction Cosines in Three Dimensions
In a rectangular coordinate system \(Oxyz\), let the unit vectors along the coordinate axes be \(i,j,k\), and let a vector \(R\) pass through the origin \(O\) with projections \(R_x,R_y,R_z\) on the axes. The vector \(R\) can be represented by its projections as \(R=R_x i+R_y j+R_z k\), and the projections can be written as
\[ R_x=R\cos\langle R,i\rangle,\quad R_y=R\cos\langle R,j\rangle,\quad R_z=R\cos\langle R,k\rangle \]
Here \(R\) is the magnitude of the vector, and \(\cos\langle R,i\rangle\), \(\cos\langle R,j\rangle\) and \(\cos\langle R,k\rangle\) are the cosines of the angles between the vector \(R\) and the positive directions of the axes \(x,y,z\). Once their values are known, the direction of the vector \(R\) in the coordinate system \(Oxyz\) is determined, so they are called the direction cosines of the vector \(R\) with respect to the axes \(x,y,z\).
Direction cosines can also describe the angular position of a rigid body. Let a rigid body rotate about a fixed point \(O\) relative to a reference coordinate system. Take a rectangular coordinate system \(Ox_r y_r z_r\) fixed to the rigid body, with unit vectors \(i_r,j_r,k_r\) along its axes, and take a rectangular coordinate system \(Ox_0 y_0 z_0\) as the reference system, with unit vectors \(i_0,j_0,k_0\) along its axes. To determine the angular position of the rigid body, it is sufficient to determine the angular position of the body coordinate system \(Ox_r y_r z_r\) in the reference coordinate system \(Ox_0 y_0 z_0\). In practice, it is sufficient to know the nine direction cosines between the three axes \(x_r,y_r,z_r\) of the body system and the three axes \(x_0,y_0,z_0\) of the reference system. These nine direction cosines form the direction cosine table (Figure 3). Here the entries are defined by the body-axis unit vectors dotted with the reference-axis unit vectors. In particular, \(C_{11}=i_r\cdot i_0\), \(C_{21}=j_r\cdot i_0\), and \(C_{31}=k_r\cdot i_0\). The matrix \(C_0^r=[C_{ij}]\) therefore maps reference components to body components: \(R^r=C_0^rR^0\). The reverse transformation is \(R^0=C_r^0R^r\), where \(C_r^0=(C_0^r)^{\mathrm T}\).

5. From Unit Vectors to Coordinates
The conversion relation between the unit vectors is
\[ i_r=C_{11}i_0+C_{12}j_0+C_{13}k_0 \] \[ j_r=C_{21}i_0+C_{22}j_0+C_{23}k_0 \] \[ k_r=C_{31}i_0+C_{32}j_0+C_{33}k_0 \qquad (10) \]
For one angular position of the body coordinate system there is a unique set of direction cosines, and vice versa, so this set of direction cosines can be used to determine the angular position of the rigid body. Direction cosines also make coordinate transformation convenient: the coordinates of a point or a vector in one coordinate system can be transformed into coordinates in another coordinate system.
Let a vector \(R\) pass through the origin \(O\) and end at a point \(M\). Let \(x_0,y_0,z_0\) directly represent the coordinates of \(R\) in the reference system \(Ox_0y_0z_0\), and let \(x_r,y_r,z_r\) directly represent the coordinates of \(R\) in the body system \(Ox_ry_rz_r\). Then \(R\) can be written in the two systems as
\[ R=x_0 i_0+y_0 j_0+z_0 k_0 \qquad (11) \] \[ R=x_r i_r+y_r j_r+z_r k_r \qquad (12) \]
Substituting equation (10) into equation (12), collecting the terms of \(i_0\), \(j_0\) and \(k_0\), and comparing the coefficients with equation (11) gives
\[ \begin{bmatrix}x_0\\y_0\\z_0\end{bmatrix} = \begin{bmatrix} \cos\langle i_r,i_0\rangle & \cos\langle j_r,i_0\rangle & \cos\langle k_r,i_0\rangle \\ \cos\langle i_r,j_0\rangle & \cos\langle j_r,j_0\rangle & \cos\langle k_r,j_0\rangle \\ \cos\langle i_r,k_0\rangle & \cos\langle j_r,k_0\rangle & \cos\langle k_r,k_0\rangle \end{bmatrix} \begin{bmatrix}x_r\\y_r\\z_r\end{bmatrix} = \begin{bmatrix}C_{11} & C_{21} & C_{31}\\C_{12} & C_{22} & C_{32}\\C_{13} & C_{23} & C_{33}\end{bmatrix} \begin{bmatrix}x_r\\y_r\\z_r\end{bmatrix} \qquad (13) \]
The direction cosine matrix is the coordinate transformation matrix from the body system \(Ox_ry_rz_r\) to the reference system \(Ox_0y_0z_0\), and is called the direction cosine matrix \(C_0^r\) of the \(r\) system with respect to the 0 system. In vector form,
\[ R^0=C_0^r R^r \qquad (14) \]
Thus the coordinates of the same vector \(R\) in different coordinate systems can be converted by the direction cosine matrix. By a similar method, the coordinates \((x_0,y_0,z_0)\) of \(R\) in \(Ox_0y_0z_0\) can be converted into the coordinates \((x_r,y_r,z_r)\) in \(Ox_ry_rz_r\):
\[ \begin{bmatrix}x_r\\y_r\\z_r\end{bmatrix} = \begin{bmatrix} \cos\langle i_0,i_r\rangle & \cos\langle j_0,i_r\rangle & \cos\langle k_0,i_r\rangle \\ \cos\langle i_0,j_r\rangle & \cos\langle j_0,j_r\rangle & \cos\langle k_0,j_r\rangle \\ \cos\langle i_0,k_r\rangle & \cos\langle j_0,k_r\rangle & \cos\langle k_0,k_r\rangle \end{bmatrix} \begin{bmatrix}x_0\\y_0\\z_0\end{bmatrix} \]
Since the direction cosine between \(i_0\) and \(i_r\) is unique, \(\cos\langle i_0,i_r\rangle=\cos\langle i_r,i_0\rangle\), and the same holds for the other pairs of axes. The inverse transformation matrix is therefore the transpose of the forward matrix, which is the algebraic form of the orthogonality used in the next section.
6. Orthogonality, Determinant, and Inverse
The row vectors and column vectors of a direction cosine matrix are orthogonal unit vectors, so their dot products are zero. For the two-dimensional direction cosine matrix above, the determinant is
\[ \left|C_x^y\right|=\begin{vmatrix}\cos\psi & \sin\psi \\ -\sin\psi & \cos\psi\end{vmatrix}=\cos^2\psi+\sin^2\psi=1 \]
The inverse is
\[ (C_x^y)^{\mathrm T}C_x^y= \begin{bmatrix}\cos\psi & -\sin\psi \\ \sin\psi & \cos\psi\end{bmatrix} \begin{bmatrix}\cos\psi & \sin\psi \\ -\sin\psi & \cos\psi\end{bmatrix} = \begin{bmatrix}1 & 0 \\ 0 & 1\end{bmatrix} \]
The orthogonality relation is
\[ \begin{bmatrix}\cos\psi & \sin\psi\end{bmatrix}\begin{bmatrix}-\sin\psi \\ \cos\psi\end{bmatrix}=-\cos\psi\sin\psi+\sin\psi\cos\psi=0 \]
These three results show that the inverse of a direction cosine matrix is its transpose, that its determinant is one, and that its rows and columns form orthonormal sets.
7. The Form of a Single-Axis Rotation
Usually the coordinate systems used in navigation are right-handed Cartesian systems. The two-dimensional direction cosine matrix above, in which the \(y\) system rotates by \(\psi\) relative to the \(x\) system, can be regarded from three-dimensional space as a rotation of the coordinate system about the third axis perpendicular to the plane of the figure. The component of the vector along the third axis clearly remains unchanged. In three-dimensional space, a direction cosine matrix \(C\) representing a rotation about the third axis can be written as
\[ C=\begin{bmatrix} \cos\psi & \sin\psi & 0 \\ -\sin\psi & \cos\psi & 0 \\ 0 & 0 & 1 \end{bmatrix} \qquad (15) \]
This matrix has three obvious features. First, the elements in the row or column corresponding to the axis about which the rotation takes place are either 1 or 0. Second, the other elements are either the sine or the cosine of the rotation angle, with the cosines on the diagonal and the sines off the diagonal. Third, the negative sign in the sine term corresponds to the component that rotates out of the quadrant formed by the original coordinate axes.
8. Composing Elementary Rotations
In the analysis above, coordinate system 2 is obtained from coordinate system 1 by a rotation through an angle \(\alpha\) about the \(Z_1\) axis only. For convenience, a rotation about one axis only is called an elementary rotation. Any complicated angular position relation between two coordinate systems can be regarded as the composition of a finite number of elementary rotations. The transformation matrix is equal to the product of the transformation matrices determined by the elementary rotations, and the multiplication order is arranged from right to left according to the order of the elementary rotations.
For example (Figure 4), the spatial attitude of a vehicle can be regarded as the result of elementary rotations about the heading axis, the pitch axis and the roll axis in sequence. The \(n\) system is the geographic coordinate system, with \(x_n\) pointing east, \(y_n\) pointing north and \(z_n\) pointing up, and the \(b\) system is the body coordinate system, with \(x_b\) pointing right, \(y_b\) pointing forward and \(z_b\) pointing up. The spatial angular position of the aircraft is determined by the following elementary rotations in sequence: a rotation \(\psi\) about the \(-z_n\) axis, a rotation \(\theta\) about the intermediate transverse axis \(x\prime\), and a rotation \(\gamma\) about the longitudinal axis \(y_b\). With the passive elementary matrices used in this article, the navigation-to-body transformation is \(C_n^b=C_y(\gamma)C_x(\theta)C_z(-\psi)\), so \(v^b=C_n^bv^n\). Multiplying the transformation matrices of the elementary rotations gives the attitude matrix. The resulting matrix has elements that are sums of products of the sines and cosines of the three angles, and the columns of its inverse \(C_b^n=(C_n^b)^{\mathrm T}\) are the body-axis unit vectors expressed in navigation coordinates.
The attitude matrix depends on the order of the rotations. When the rotation angles \(\psi\), \(\theta\) and \(\gamma\) are not all small, different rotation orders give different final spatial positions of the \(b\) system. This is the non-commutativity of finite rotations. When \(\psi\), \(\theta\) and \(\gamma\) are all small, the higher-order small quantities can be neglected and the transformation matrix can be simplified.

9. Coordinate Rotation and Vector Rotation
The analysis above belongs to the relative rotation of coordinate systems, in which the point \(M\), that is, the position vector \(O\), does not move. The transformation of unit vectors and coordinates can also be performed with the coordinate system fixed and the position vector rotated in the opposite direction. The corresponding coordinate transformation is \([X_0\ Y_0]^{\mathrm T}=A^{\mathrm T}[x\ y]^{\mathrm T}\). It can be seen that the transition matrices for a coordinate system rotation and for a position vector rotation are transposes of each other.
This transpose relation is the source of the active/passive confusion: fixed axes with a turning vector, or a fixed vector with turning axes. The numerical matrix is the same up to a transpose, so the first check is which description the matrix was built for.
10. The Differential Equation of the DCM
Figure 5 considers a fixed vector \(r\) and a moving \(y\) coordinate system. Let \(\tau\) denote time. Over an interval \(\Delta\tau\), the axes turn counterclockwise through the small angle \(\Delta\psi\), measured in radians. To first order,
\[ y_1(\tau+\Delta\tau)\approx y_1(\tau)+\Delta\psi\,y_2(\tau),\qquad y_2(\tau+\Delta\tau)\approx y_2(\tau)-\Delta\psi\,y_1(\tau). \]
Define the dimensionless skew-symmetric angle increment \[ \Omega=\begin{bmatrix}0&-\Delta\psi\\ \Delta\psi&0\end{bmatrix},\qquad \Omega^{\mathrm T}=-\Omega. \] The matrix \(I-\Omega\), rather than \(\Omega\) itself, updates the vector components. Thus
\[ C_x^y(\tau+\Delta\tau)\approx(I-\Omega)C_x^y(\tau). \]
The angle increment and the angular-rate matrix are different quantities. Define \(W^y=[\omega_{xy}^y\times]\) as the skew-symmetric cross-product matrix of the angular velocity of frame \(y\) relative to frame \(x\), expressed in frame \(y\). For the planar example, \(W^y=\lim_{\Delta\tau\to0}\Omega/\Delta\tau\). For a fixed vector expressed in the two frames, the passive DCM obeys
\[ \frac{dC_x^y}{d\tau}=-W^yC_x^y. \]
In three dimensions, for \(\omega_{xy}^y=[\omega_1\ \omega_2\ \omega_3]^{\mathrm T}\), \[ W^y=\begin{bmatrix}0&-\omega_3&\omega_2\\\omega_3&0&-\omega_1\\-\omega_2&\omega_1&0\end{bmatrix}. \] If the same relative angular velocity is expressed in frame \(x\), write \(W^x=[\omega_{xy}^x\times]\); then \(W^y=C_x^yW^x(C_x^y)^{\mathrm T}\), and the equivalent right-multiplied form is \(dC_x^y/d\tau=-C_x^yW^x\). The inverse matrix has a different equation: \(dC_y^x/d\tau=C_y^xW^y\). Changing the matrix direction or the frame in which angular velocity is expressed must therefore be stated explicitly.

11. DCM from a Quaternion
A direction cosine matrix can also be constructed directly from a quaternion. Let there be a reference coordinate system \(R\), with axes \(x_0,y_0,z_0\) and unit vectors \(i_0,j_0,k_0\). A rigid body rotates about a fixed point \(O\) relative to the \(R\) system. Take a coordinate system \(b\) fixed to the rigid body, with axes \(x,y,z\) and unit vectors \(i,j,k\). Suppose that at the initial instant the \(b\) system coincides with the \(R\) system. To analyse the spatial angular position of the rigid body, take a point \(A\) on the body and draw the position vector \(OA\) from the rotation point \(O\) to that point. The spatial position of this position vector then describes the spatial angular position of the rigid body.
According to Euler’s theorem, considering only the angular positions of the rigid body at the initial instant and at time \(t\), the rotation from the initial position to the final position can be equivalently completed as a single rotation about the instantaneous axis through an angle \(\theta\). Let the body-fixed coordinate system at the initial instant be \(b_0\). Since the body-fixed system coincides with the reference system at the initial instant, \(r^R=r^{b_0}\). During the rotation the position vector and the \(b\) system are both fixed to the rigid body, so their relative angular position does not change, and \(r^{b_0}=r^b\). Therefore \(r^R=Dr^b\). This equation shows that \(D\) is the coordinate transformation matrix from the \(b\) system to the \(R\) system. From the quaternion relations it can be written as
\[ D= \begin{bmatrix} 1-2(y^2+z^2) & 2(xy-wz) & 2(xz+wy) \\ 2(xy+wz) & 1-2(x^2+z^2) & 2(yz-wx) \\ 2(xz-wy) & 2(yz+wx) & 1-2(x^2+y^2) \end{bmatrix} \qquad (16) \]
where \(w\), \(x\), \(y\) and \(z\) are the quaternion describing the rotation. The diagonal terms are formed from the squares of the quaternion components, while the off-diagonal terms are formed from the products of two components together with the scalar part. Each element of the matrix is therefore a quadratic combination of the four quaternion components.
Figure 6 shows a chain from inertial frame \(i\), through Earth-fixed frame \(e\) and local geographic frame \(t\), to body frame \(b\). Each DCM converts the components of the same free vector; it does not translate a position origin. Transforming point coordinates between different origins additionally requires a translation. We use \(\tau\) for elapsed time and reserve \(t\) as the geographic frame label.
Assume the inertial and Earth-fixed axes coincide at \(\tau=0\), with their third axes along the Earth rotation axis. The inertial-to-Earth transformation is \[ C_i^e(\tau)=\begin{bmatrix}\cos(\omega_{ie}\tau)&\sin(\omega_{ie}\tau)&0\\-\sin(\omega_{ie}\tau)&\cos(\omega_{ie}\tau)&0\\0&0&1\end{bmatrix}. \] An implementation with a different epoch must include the corresponding initial Earth rotation angle.
Let \(\lambda\) be longitude and \(\varphi\) latitude. For local east-north-up axes, the Earth-to-geographic DCM is \[ C_e^t= \begin{bmatrix} -\sin\lambda & \cos\lambda & 0 \\ -\sin\varphi\cos\lambda & -\sin\varphi\sin\lambda & \cos\varphi \\ \cos\varphi\cos\lambda & \cos\varphi\sin\lambda & \sin\varphi \end{bmatrix} \]
The geographic frame \(t\) is the same type of local frame denoted by \(n\) in section 8. With body axes x right, y forward, z up and clockwise-positive heading, the geographic-to-body DCM is \[ C_t^b=C_y(\gamma)C_x(\theta)C_z(-\psi). \] Its inverse \(C_b^t=(C_t^b)^{\mathrm T}\) converts body components into local geographic components.
The complete chain is \[ v^b=C_t^bC_e^tC_i^ev^i. \] The rightmost matrix acts first. The angles \(\psi,\theta,\gamma\) are heading, pitch and roll under the convention specified in section 8.

13. Subscript Conventions
This article consistently defines \(C_a^b\) by \(r^b=C_a^b r^a\): the lower label is the source frame and the upper label the target frame. Thus \(C_1^2\) and \(C_0^r\) follow the same rule. Other references may use different conventions. Before importing a matrix, verify its defining component equation and a known basis vector rather than inferring direction from the appearance of its indices.
14. A Worked Example: Thirty Degrees About the z Axis
Take a vector \(r^1=[1\ 0\ 0]^{\mathrm T}\) and rotate the coordinate system by \(\alpha=30^{\circ}\) about \(Z_1\). From equation (1),
\[ r^2= \begin{bmatrix} \cos30^{\circ} & \sin30^{\circ} & 0 \\ -\sin30^{\circ} & \cos30^{\circ} & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix}1\\0\\0\end{bmatrix} = \begin{bmatrix}0.866\\-0.5\\0\end{bmatrix} \]
The vector has unit length in both frames, as it must. The first component is shorter and a negative second component has appeared, because the target frame has turned. If the same numerical matrix were applied in the opposite direction, the sign of the second component would be wrong. Checking a unit basis vector in this way catches both a transposed matrix and an inverted rotation angle.
15. DCM in IMU Attitude Solutions
In an IMU, the DCM is the object that carries the body frame into the navigation frame. A strapdown solution propagates the attitude matrix from the measured angular rate and then uses it to rotate the measured specific force into the navigation frame before gravity is added and the Coriolis and frame-transport terms are subtracted in the navigation equation. If the propagated matrix drifts away from orthonormality, the rotated specific force acquires a scale error and a tilt error. The Euler-angle representation is easier to read but has singularities, and the angular momentum of a rotor is described in the same frame language as the gyroscope rate. Cross-axis sensitivity enters as an error in the vector before the rotation, not after it.
16. Concluding Remarks
A direction cosine matrix is a compact statement of how one set of axes is oriented relative to another. Its columns are the target-frame representations of the source axes, its inverse is its transpose, and its determinant is one. Elementary rotations multiply from right to left, finite rotations do not commute, and the same physical rotation can be written with either the axes turning or the vector turning, up to a transpose.
