For two sets of coordinate axe \(K\) and \(K^\prime\) having common origin, an explicit form of the rotation matrix connecting them is obtained in terms of direction cosines.
Let $K$ and $K^\prime$ be two sets of coordinate axes. Then the position vectors of a point w.r.t. the two coordinate axes are linearly related.
\begin{equation} \begin{pmatrix}x_1^\prime \\ x_2^\prime\\ x_3^\prime\end{pmatrix} = R \begin{pmatrix}x_1 \\ x_2\\ x_3\end{pmatrix}. \end{equation}
We wish to obtain an explicit expression of the matrix \(R\) in terms of direction cosines. Let the axes be such that
- $l_1,m_1,n_1$ are direction cosines of the old $X_1$ axis w.r.t. the new axes $K^{\,\prime}$.
- $l_2,m_2,n_2$ are direction cosines of the old $X_2$ axis w.r.t. the new axes $K^{\,\prime}$.
- $l_3,m_3,n_3$ are direction cosines of the old $X_3$ axis w.r.t. the new axes $K^{\,\prime}$
For a point at unit distance from the origin and lying on the old axis
$0{X_1}$, we have
\begin{equation}x=\left[\begin{array}{c}1\\0\\0\end{array}\right] \text{ and }
x^\prime= \left[\begin{array}{c}l_1\\m_1\\n_1\end{array}\right]\end{equation}
\begin{equation}
\Longrightarrow \left[\begin{array}{c}l_1\\m_1\\n_1
\end{array}\right]=R\left[\begin{array}{c}1\\0\\0
\end{array}\right].
\end{equation}
Similarly, by considering points on $0{X_2}$ and $0{X_3}$ we get
\begin{equation}
\left[\begin{array}{c}l_2\\m_2\\n_2\end{array}\right]
=R \left[\begin{array}{c}0\\1\\0\end{array}\right], \qquad
\left[\begin{array}{c}l_3\\m_3\\n_3\end{array}\right]
=R\left[\begin{array}{c}0\\0\\1\end{array}\right].
\end{equation}
Combining (2)-(3) we can write
\begin{equation}
R=\left[\begin{array}{clcr}
l_1 &l_2 &l_3\\
m_1 &m_2 &m_3\\
n_1 &n_2 &n_3
\end{array}\right] .
\end{equation}