mathematics//linear algebra//orthogonal matrix

An orthogonal matrix is a square matrix whose columns are perpendicular unit vectors, so that its transpose is its inverse, and it is the kind of transformation that moves vectors without deforming them: lengths, angles and distances all survive. That is a rotation, possibly combined with a reflection, and it is why orthogonal matrices are where numerical linear algebra goes to be safe.


An orthogonal matrix is a square matrix whose columns are perpendicular unit vectors, so that its transpose is its inverse, and it is the kind of transformation that moves vectors without deforming them: lengths, angles and distances all survive. That is a rotation, possibly combined with a reflection, and it is why orthogonal matrices are where numerical linear algebra goes to be safe.

QTQ=I,Q−1=QT,∥Qx∥=∥x∥,det⁡Q=±1Q^{\mathsf T}Q=I,\qquad Q^{-1}=Q^{\mathsf T},\qquad \|Qx\|=\|x\|,\qquad \det Q=\pm1QTQ=I,Q−1=QT,∥Qx∥=∥x∥,detQ=±1

The last identity separates the two kinds: determinant +1 is a proper rotation, −1 includes a reflection (a mirror, or two axes swapped). The inverse costs nothing, a transpose, and it is exact, with no division and no rounding beyond what the multiplication itself adds.

An orthogonal matrix has condition number 1, the best possible.

Multiplying by it neither amplifies errors nor loses digits, which is why the stable algorithms of numerical linear algebra are built from orthogonal pieces: the QQQ of a QR decomposition and the UUU and VVV of the SVD.

The SVD reads every matrix through two of them: any matrix is an orthogonal matrix, a stretch along the axes and another orthogonal matrix, so all the deformation lives in the diagonal middle and the condition number is read straight off it.

The eigenvectors of a symmetric matrix can always be chosen orthonormal, so a covariance or a graph Laplacian is diagonalized by an orthogonal matrix (eigendecomposition). PCA is that change of basis: it rotates the sensor axes onto the directions of the data without distorting distances.

In code, an orthogonal matrix that should stay orthogonal drifts. A rotation matrix updated by integrating gyroscope rates for minutes accumulates rounding until its columns are no longer unit length or perpendicular, and it starts to stretch what it should only turn; attitude code re-orthonormalizes it periodically, or stores the attitude as a quaternion, whose single constraint is cheaper to restore.

Orthogonal means more than the columns are perpendicular: they must also have unit length. A matrix with perpendicular columns of different lengths is a rotation times a scaling, and its transpose is not its inverse.