A direction cosine matrix (DCM) is a transformation matrix that transforms one coordinate reference frame to another. If we extend the concept of how the three dimensional direction cosines locate a vector, then the DCM locates three unit vectors that describe a coordinate reference frame. Using the notation in equation 1, we need to find the matrix elements that correspond to the correct transformation matrix.
![{\displaystyle DCM=\left[{\begin{matrix}A_{11}&A_{12}&A_{13}\\A_{21}&A_{22}&A_{23}\\A_{31}&A_{32}&A_{33}\end{matrix}}\right]}](https://wikimedia.org/api/rest_v1/media/math/render/svg/bf971336766cf69f596285261dc5c84913eaf594)
The first unit vector of the second coordinate frame can be located in the first frame by normal vector notation. See figure 1 for relationship.
\medskip
\begin{figure}
\includegraphics[scale=0.78]{DCM.eps}
\end{figure}
\medskip
Similarily, the other two unit vectors can be described by
It is easy to see how equation 1 works as a transformation matrix through simple matrix multiplication.
![{\displaystyle \left[{\begin{matrix}{\hat {y}}_{1}\\{\hat {y}}_{2}\\{\hat {y}}_{3}\end{matrix}}\right]=\left[{\begin{matrix}A_{11}&A_{12}&A_{13}\\A_{21}&A_{22}&A_{23}\\A_{31}&A_{32}&A_{33}\end{matrix}}\right]\left[{\begin{matrix}{\hat {x}}_{1}\\{\hat {x}}_{2}\\{\hat {x}}_{3}\end{matrix}}\right]}](https://wikimedia.org/api/rest_v1/media/math/render/svg/872896370d6b23e445eaf8c6eed74d044855a1a4)
Once this transformation matrix is found, it can be used to transform vectors from the second frame to the first frame and vice versa. Equation 2 transforms the x frame to the y frame and can be denoted as
. In order to get
, which transforms the y frame to the x frame, we use a property of transformation matrices of orthonormal reference frames (a frame that is described by unit vectors and are perpindicular to each other). See the entry on a transformation matrix for more info on its properties. We use the properties that
![{\displaystyle R_{1-2}R_{1-2}^{T}=\left[{\begin{matrix}1&0&0\\0&1&0\\0&0&1\end{matrix}}\right]}](https://wikimedia.org/api/rest_v1/media/math/render/svg/187c96ce55a3a2a2b8329b51e3088cd8d3822712)
so using these properties and rearranging equation 2
yields
![{\displaystyle R_{1-2}^{-1}{\hat {y}}=R_{1-2}^{-1}R_{1-2}{\hat {x}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/d25898289201c440833d71dee638ef162239e41f)
giving the transformation of the y frame to the x frame
![{\displaystyle {\hat {x}}=R_{2-1}{\hat {y}}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7dfc5041fea5ea868d442c0634c8592e651d6fbd)
So to extend this concept to transform vectors from one frame to another a closer examination of a vector being represented in both frames is needed. If we denote the second frame as the prime (
) frame, then a vector expressed in each of these is given by
![{\displaystyle v=v_{1}{\hat {x}}_{1}+v_{2}{\hat {x}}_{2}+v_{3}{\hat {x}}_{3}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/c536c5edbf65cdd055924971f6fbf3325e801cb3)
![{\displaystyle v=v_{1}\prime {\hat {y}}_{1}+v_{2}\prime {\hat {y}}_{2}+v_{3}\prime {\hat {y}}_{3}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b20b92813789f5e73a34285a8ae0299d88b3dafc)
Since both equations describe the same vector, let us set them equal to each other so
![{\displaystyle v_{1}{\hat {x}}_{1}+v_{2}{\hat {x}}_{2}+v_{3}{\hat {x}}_{3}=v_{1}\prime {\hat {y}}_{1}+v_{2}\prime {\hat {y}}_{2}+v_{3}\prime {\hat {y}}_{3}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/166d0a8241afbf4a5eb30818224cbb82622d7e3e)
This notation is clumsy so we want to represent it in matrix notation. This is simple enough if you have an understanding of multiplying a column vector by a row vector. This allows us to describe equations 3 and 4 by
![{\displaystyle v=\left[{\begin{matrix}v_{1}\prime &v_{2}\prime &v_{3}\prime \end{matrix}}\right]\left[{\begin{matrix}{\hat {y}}_{1}\\{\hat {y}}_{2}\\{\hat {y}}_{3}\end{matrix}}\right]}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7b5d1e3b1dd4bcbf61da9085c410884a0c73f7b5)
Setting them equal and substituting equation 2 in for the second coordinate frame yields
![{\displaystyle v=\left[{\begin{matrix}v_{1}&v_{2}&v_{3}\end{matrix}}\right]\left[{\begin{matrix}{\hat {x}}_{1}\\{\hat {x}}_{2}\\{\hat {x}}_{3}\end{matrix}}\right]=\left[{\begin{matrix}v_{1}\prime &v_{2}\prime &v_{3}\prime \end{matrix}}\right]\left[{\begin{matrix}A_{11}&A_{12}&A_{13}\\A_{21}&A_{22}&A_{23}\\A_{31}&A_{32}&A_{33}\end{matrix}}\right]\left[{\begin{matrix}{\hat {x}}_{1}\\{\hat {x}}_{2}\\{\hat {x}}_{3}\end{matrix}}\right]}](https://wikimedia.org/api/rest_v1/media/math/render/svg/86038baa75d556246c5c00c72ddb554b80369065)
Then by inspection (or go through the matrix manipulation to cancel the x frame)
![{\displaystyle \left[{\begin{matrix}v_{1}&v_{2}&v_{3}\end{matrix}}\right]=\left[{\begin{matrix}v_{1}\prime &v_{2}\prime &v_{3}\prime \end{matrix}}\right]\left[{\begin{matrix}A_{11}&A_{12}&A_{13}\\A_{21}&A_{22}&A_{23}\\A_{31}&A_{32}&A_{33}\end{matrix}}\right]}](https://wikimedia.org/api/rest_v1/media/math/render/svg/7f74395986327653672d2e0949d82e069b1eaa33)
Representing the transformation matrix as
as the transformation from the first frame to the second frame and transposing the previous equation gives
![{\displaystyle \left[{\begin{matrix}v_{1}&v_{2}&v_{3}\end{matrix}}\right]=(\left[{\begin{matrix}v_{1}\prime &v_{2}\prime &v_{3}\prime \end{matrix}}\right]R_{1-2})^{T}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/03f1d76b8c0b2bdceebe8a735dac7ac99a6c82e4)
Performing the transposition and using a transposition property for two matrices A and B such that
![{\displaystyle (AB)^{T}=B^{T}A^{T}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/0df1305b8040ec70a9e90c1071806770e34feddf)
leads to the relationship
![{\displaystyle \left[{\begin{matrix}v_{1}\\v_{2}\\v_{3}\end{matrix}}\right]=R_{1-2}^{T}\left[{\begin{matrix}v_{1}\prime \\v_{2}\prime \\v_{3}\prime \end{matrix}}\right]}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b42a854dfb73d1083a16efc4469d0f90e9e318f9)
Finally giving us the ability to transform a vector from the second (prime) frame to the first frame.
![{\displaystyle {\vec {v}}=R_{2-1}{\vec {v\prime }}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/491a0ca5b700acedcea55e03efea0df93613e8b1)
Much much more can be found in the general entry about the Transformation matrix.