In linear algebra, an orthogonal matrix or orthonormal matrix , is a real-valued square matrix whose columns and rows are orthonormal vectors.

One way to express this is

where is the transpose of and is the identity matrix.

This leads to the equivalent characterization: a matrix is orthogonal if its transpose is equal to its inverse:

where is the inverse of .

An orthogonal matrix is necessarily invertible (with inverse ), unitary (), where is the Hermitian adjoint (conjugate transpose) of , and therefore normal () over the real numbers. The determinant of any orthogonal matrix is either +1 or −1. As a linear transformation, an orthogonal matrix preserves the inner product of vectors, and therefore acts as an isometry of Euclidean space, such as a rotation, reflection or rotoreflection. In other words, it is a unitary transformation.

The set of orthogonal matrices, under multiplication, forms the group , known as the orthogonal group. The subgroup consisting of orthogonal matrices with determinant +1 is called the special orthogonal group, and each of its elements is a special orthogonal matrix, which represents a rotation. The orthogonal matrices with determinant -1 form the coset , and together with , they form .

Overview

An orthogonal matrix is the real specialization of a unitary matrix, and thus always a normal matrix. Although we consider only real matrices here, the definition can be used for matrices with entries from any field. However, orthogonal matrices arise naturally from dot products, and for matrices of complex numbers that leads instead to the unitary requirement. Orthogonal matrices preserve the dot product, so, for vectors and in an -dimensional real Euclidean space

where is an orthogonal matrix. To see the inner product connection, consider a vector in an -dimensional real Euclidean space. Written with respect to an orthonormal basis, the squared length of is . If a linear transformation, in matrix form , preserves vector lengths, then

Thus finite-dimensional linear isometries—rotations, reflections, and their combinations—produce orthogonal matrices. The converse is also true: orthogonal matrices imply orthogonal transformations. However, linear algebra includes orthogonal transformations between spaces which may be neither finite-dimensional nor of the same dimension, and these have no orthogonal matrix equivalent.

Orthogonal matrices are important for a number of reasons, both theoretical and practical. The orthogonal matrices form a group under matrix multiplication, the orthogonal group denoted by , which—with its subgroups—is widely used in mathematics and the physical sciences. For example, the point group of a molecule is a subgroup of O(3). Because floating point versions of orthogonal matrices have advantageous properties, they are key to many algorithms in numerical linear algebra, such as decomposition. As another example, with appropriate normalization the discrete cosine transform (used in MP3 compression) is represented by an orthogonal matrix.

Examples Below are a few examples of small orthogonal matrices and possible interpretations.    (identity transformation)    (rotation about the origin)    (reflection across x-axis)    (permutation of coordinate axes)

Elementary constructions

Lower dimensions The simplest orthogonal matrices are the matrices and [−1], which we can interpret as the identity and a reflection of the real line across the origin.

The matrices have the form

which orthogonality demands satisfy the three equations

In consideration of the first equation, without loss of generality let , ; then either , or , . We can interpret the first case as a rotation by (where is the identity), and the second as a reflection across a line at an angle of .

The special case of the reflection matrix with generates a reflection about the line at 45° given by and therefore exchanges and ; it is a permutation matrix, with a single 1 in each column and row (and otherwise 0):

The identity is also a permutation matrix.

A reflection is its own inverse, which implies that a reflection matrix is symmetric (equal to its transpose) as well as orthogonal. The product of two rotation matrices is a rotation matrix, and the product of two reflection matrices is also a rotation matrix.

Higher dimensions Regardless of the dimension, it is always possible to classify orthogonal matrices as purely rotational or not, but for matrices and larger the non-rotational matrices can be more complicated than reflections. For example,

represent an inversion through the origin and a rotoinversion, respectively, about the -axis.

Rotations become more complicated in higher dimensions; they can no longer be completely characterized by one angle, and may affect more than one planar subspace. It is common to describe a rotation matrix in terms of an axis and angle, but this only works in three dimensions. Above three dimensions two or more angles are needed, each associated with a plane of rotation.

However, we have elementary building blocks for permutations, reflections, and rotations that apply in general.

Primitives The most elementary permutation is a transposition, obtained from the identity matrix by exchanging two rows. Any permutation matrix can be constructed as a product of no more than transpositions.

A Householder reflection is constructed from a non-null vector as

Here the numerator is a symmetric matrix while the denominator is a number, the squared magnitude of . This is a reflection in the hyperplane perpendicular to (negating any vector component parallel to ). If is a unit vector, then suffices. A Householder reflection is typically used to simultaneously zero the lower part of a column. Any orthogonal matrix of size can be constructed as a product of at most such reflections.

A Givens rotation acts on a two-dimensional (planar) subspace spanned by two coordinate axes, rotating by a chosen angle. It is typically used to zero a single subdiagonal entry. Any rotation matrix of size can be constructed as a product of at most such rotations. In the case of matrices, three such rotations suffice; and by fixing the sequence we can thus describe all rotation matrices (though not uniquely) in terms of the three angles used, often called Euler angles.

A Jacobi rotation has the same form as a Givens rotation, but is used to zero both off-diagonal entries of a symmetric submatrix.

Properties

Matrix properties A real square matrix is orthogonal if and only if its columns form an orthonormal basis of the Euclidean space with the ordinary Euclidean dot product, which is the case if and only if its rows form an orthonormal basis of . It might be tempting to suppose a matrix with orthogonal (not orthonormal) columns would be called an orthogonal matrix, but such matrices have no special interest and no special name; they only satisfy , with a diagonal matrix.

The determinant of any orthogonal matrix is +1 or −1. This follows from basic facts about determinants, as follows:

The converse is not true; having a determinant of ±1 is no guarantee of orthogonality, even with orthogonal columns, as shown by the following counterexample.

With permutation matrices the determinant matches the signature, being +1 or −1 as the parity of the permutation is even or odd, for the determinant is an alternating function of the rows.

Stronger than the determinant restriction is the fact that an orthogonal matrix can always be diagonalized over the complex numbers to exhibit a full set of eigenvalues, all of which must have (complex) modulus 1.

Group properties The inverse of every orthogonal matrix is again orthogonal, as is the matrix product of two orthogonal matrices. In fact, the set of all orthogonal matrices satisfies all the axioms of a group. It is a compact Lie group of dimension , called the orthogonal group and denoted by .

The orthogonal matrices whose determinant is +1 form a path-connected normal subgroup of of index 2, the special orthogonal group of rotations. The quotient group is isomorphic to , with the projection map choosing [+1] or [−1] according to the determinant. Orthogonal matrices with determinant −1 do not include the identity, and so do not form a subgroup but only a coset; it is also (separately) connected. Thus each orthogonal group falls into two pieces; and because the projection map splits, is a semidirect product of by . In practical terms, a comparable statement is that any orthogonal matrix can be produced by taking a rotation matrix and possibly negating one of its columns, as we saw with matrices. If is odd, then the semidirect product is in fact a direct product, and any orthogonal matrix can be produced by taking a rotation matrix and possibly negating all of its columns. This follows from the property of determinants that negating a column negates the determinant, and thus negating an odd (but not even) number of columns negates the determinant.

Now consider orthogonal matrices with bottom right entry equal to 1. The remainder of the last column (and last row) must be zeros, and the product of any two such matrices has the same form. The rest of the matrix is an orthogonal matrix; thus is a subgroup of (and of all higher groups).

Since an elementary reflection in the form of a Householder matrix can reduce any orthogonal matrix to this constrained form, a series of such reflections can bring any orthogonal matrix to the identity; thus an orthogonal group is a reflection group. The last column can be fixed to any unit vector, and each choice gives a different copy of in ; in this way is a bundle over the unit sphere with fiber .

Similarly, is a subgroup of ; and any special orthogonal matrix can be generated by Givens plane rotations using an analogous procedure. The bundle structure persists: . A single rotation can produce a zero in the first row of the last column, and series of rotations will zero all but the last row of the last column of an rotation matrix. Since the planes are fixed, each rotation has only one degree of freedom, its angle. By induction, therefore has

degrees of freedom, and so does .

Permutation matrices are simpler still; they form, not a Lie group, but only a finite group, the order symmetric group . By the same kind of argument, is a subgroup of . The even permutations produce the subgroup of permutation matrices of determinant +1, the order alternating group.

Canonical form More broadly, the effect of any orthogonal matrix separates into independent actions on orthogonal two-dimensional subspaces. That is, if is special orthogonal then one can always find an orthogonal matrix , a (rotational) change of basis, that brings into block diagonal form:

where the matrices are rotation matrices, and with the remaining entries zero. Exceptionally, a rotation block may be diagonal, . Thus, negating one column if necessary, and noting that a reflection diagonalizes to a +1 and −1, any orthogonal matrix can be brought to the form /

The matrices give conjugate pairs of eigenvalues lying on the unit circle in the complex plane; so this decomposition confirms that all eigenvalues have absolute value 1. If is odd, there is at least one real eigenvalue, +1 or −1; for a rotation, the eigenvector associated with +1 is the rotation axis.

Lie algebra Suppose the entries of are differentiable functions of , and that gives . Differentiating the orthogonality condition

yields

Evaluation at () then implies

In Lie group terms, this means that the Lie algebra of an orthogonal matrix group consists of skew-symmetric matrices. Going the other direction, the matrix exponential of any skew-symmetric matrix is an orthogonal matrix (in fact, special orthogonal).

For example, the three-dimensional object physics calls angular velocity is a differential rotation, thus a vector in the Lie algebra tangent to . Given , with being a unit vector, the correct skew-symmetric matrix form of is