Direction Cosines
Consider a line passing through the origin in three-dimensional space. The line forms angles with the coordinate axes , , and . Let these angles be , , and . (See Figure 1) The cosines of these angles are called direction cosines and describe the orientation of the line.
The squares of the direction cosines always sum to one because they represent the components of a unit direction vector.

If two lines are given by direction cosines and , then the cosine of the angle between the lines is equal to the dot product of the direction cosine vectors. (See Figure 2)
The angle between two lines is computed using the dot product of their unit direction vectors.

Rotation Matrix Definition
A rotation of a coordinate system can be described by the cosines of the angles between the original axes and the rotated axes . These cosines are written as and form the rotation matrix.
Each element of the rotation matrix represents the cosine of the angle between a rotated axis and an original axis.
Although the rotation matrix contains nine elements, only three are independent because the coordinate axes must remain perpendicular and have unit length.
Orthogonality Conditions
Since the rotated coordinate axes remain perpendicular to each other, the direction cosines must satisfy orthogonality conditions. These conditions ensure that different axes remain perpendicular after rotation.
Different rows of the rotation matrix are orthogonal
Each axis has unit length after rotation.
The rows of the rotation matrix form an orthonormal set of vectors
The Kronecker delta distinguishes equal and unequal indices
Column Orthogonality
The same reasoning can be applied by expressing the original axes in terms of the rotated axes. This produces a second orthogonality condition showing that the columns of the rotation matrix are also orthonormal.
The columns of a rotation matrix are orthonormal vectors.
The inverse of a rotation matrix is equal to its transpose.
Rotation Interpretation
A rotation transformation can be interpreted in two equivalent ways. Either the coordinate axes rotate while the point remains fixed, or the coordinate axes remain fixed while the point rotates. Both interpretations produce the same transformation matrix.
Coordinate Transformation
Consider a point with coordinates in the original coordinate system. After a rotation through an angle , the coordinates in the rotated system become:
First coordinate after rotation.
Second coordinate after rotation.
Matrix representation of a two-dimensional rotation.