orthogonal matrix


linear algebra Linear algebra is the branch of mathematics concerning linear equations such as: :a_1x_1+\cdots +a_nx_n=b, linear maps such as: :(x_1, \ldots, x_n) \mapsto a_1x_1+\cdots +a_nx_n, and their representations in vector spaces and through matrix (math ...
, an orthogonal matrix, or orthonormal matrix, is a real
square matrix In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...
whose columns and rows are
orthonormalIn linear algebra, two vectors in an inner product space are orthonormal if they are orthogonal (or perpendicular along a line) unit vector In mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quanti ...
vectors Vector may refer to: Biology *Vector (epidemiology), an agent that carries and transmits an infectious pathogen into another living organism; a disease vector *Vector (molecular biology), a DNA molecule used as a vehicle to artificially carr ...
. One way to express this is :Q^\mathrm Q = Q Q^\mathrm = I, where is the
transpose In linear algebra, the transpose of a matrix Matrix or MATRIX may refer to: Science and mathematics * Matrix (mathematics), a rectangular array of numbers, symbols, or expressions * Matrix (logic), part of a formula in prenex normal form * Matr ...

of and is the
identity matrix In linear algebra, the identity matrix of size ''n'' is the ''n'' × ''n'' square matrix with ones on the main diagonal and zeros elsewhere. It is denoted by ''I'n'', or simply by ''I'' if the size is immaterial or can be trivially determined by ...

identity matrix
. This leads to the equivalent characterization: a matrix is orthogonal if its transpose is equal to its
inverse Inverse or invert may refer to: Science and mathematics * Inverse (logic), a type of conditional sentence which is an immediate inference made from another conditional sentence * Additive inverse (negation), the inverse of a number that, when add ...
: :Q^\mathrm=Q^, where is the inverse of . An orthogonal matrix is necessarily invertible (with inverse ),
unitary Unitary may refer to: * Unitary construction, in automotive design a common term for unibody (unitary body/chassis) construction * Lethal Unitary Chemical Agents and Munitions (Unitary), as chemical weapons opposite of Binary * Unitarianism, in Chr ...
(), where is the
Hermitian adjointIn mathematics Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ha ...
conjugate transpose In mathematics, the conjugate transpose (or Hermitian transpose) of an ''m''-by-''n'' matrix (mathematics), matrix \boldsymbol with complex number, complex entries is the ''n''-by-''m'' matrix obtained from \boldsymbol by taking the transpose and ...
) of , and therefore normal () over the real numbers. The determinant of any orthogonal matrix is either +1 or −1. As a Linear map, linear transformation, an orthogonal matrix preserves the inner product of vectors, and therefore acts as an isometry of Euclidean space, such as a Rotation (mathematics), rotation, Reflection (mathematics), reflection or Improper rotation, rotoreflection. In other words, it is a unitary transformation. The set of orthogonal matrices forms a group (mathematics), group, , known as the orthogonal group. The subgroup consisting of orthogonal matrices with determinant +1 is called the Orthogonal group, special orthogonal group, and each of its elements is a special orthogonal matrix. As a linear transformation, every special orthogonal matrix acts as a rotation.


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 (mathematics), 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 : \cdot = \left(Q \right) \cdot \left(Q \right) 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 :^\mathrm = (Q)^\mathrm(Q) = ^\mathrm Q^\mathrm Q . Thus dimension (vector space), 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 (mathematics), 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 QR decomposition, decomposition. As another example, with appropriate normalization the discrete cosine transform (used in MP3 compression) is represented by an orthogonal matrix.


Below are a few examples of small orthogonal matrices and possible interpretations. * \begin 1 & 0 \\ 0 & 1 \\ \end    (identity transformation) * \begin \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \\ \end    * \begin \cos 16.26^\circ & -\sin 16.26^\circ \\ \sin 16.26^\circ & \cos 16.26^\circ \\ \end \approx \left[\begin 0.96 & -0.28 \\ 0.28 & 0.96 \\ \end\right](rotation by 16.26°) * \begin 1 & 0 \\ 0 & -1 \\ \end    (reflection across ''x''-axis) * \begin 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \end    (permutation of coordinate axes)

Elementary constructions

Lower dimensions

The simplest orthogonal matrices are the matrices [1] and [−1], which we can interpret as the identity and a reflection of the real line across the origin. The matrices have the form :\begin p & t\\ q & u \end, which orthogonality demands satisfy the three equations : \begin 1 & = p^2+t^2, \\ 1 & = q^2+u^2, \\ 0 & = pq+tu. \end 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 . : \begin \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \\ \end\text\qquad \begin \cos \theta & \sin \theta \\ \sin \theta & -\cos \theta \\ \end\text 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): :\begin 0 & 1\\ 1 & 0 \end. The identity is also a permutation matrix. A reflection is Involutory matrix, its own inverse, which implies that a reflection matrix is symmetric matrix, 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, : \begin -1 & 0 & 0\\ 0 & -1 & 0\\ 0 & 0 & -1 \end\text \begin 0 & -1 & 0\\ 1 & 0 & 0\\ 0 & 0 & -1 \end represent an ''Inversion in a point, inversion'' through the origin and a ''improper rotation, 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.


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 :Q = I - 2 \frac . 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.


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: :1=\det(I)=\det\left(Q^\mathrmQ\right)=\det\left(Q^\mathrm\right)\det(Q)=\bigl(\det(Q)\bigr)^2 . 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. :\begin 2 & 0 \\ 0 & \frac \end With permutation matrices the determinant matches the even and odd permutations, 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 diagonalizable matrix, diagonalized over the complex numbers to exhibit a full set of Eigenvalues and eigenvectors, eigenvalues, all of which must have (complex) absolute value, 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 (mathematics), group. It is a compact space, compact Lie group of dimension , called the orthogonal group and denoted by . The orthogonal matrices whose determinant is +1 form a connected space, path-connected normal subgroup of of index of a subgroup, 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 exact sequence, 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 of groups, 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). :\begin & & & 0\\ & \mathrm(n) & & \vdots\\ & & & 0\\ 0 & \cdots & 0 & 1 \end 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 fiber bundle, bundle over the unit sphere with fiber . Similarly, is a subgroup of ; and any special orthogonal matrix can be generated by Givens rotation, 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 :(n-1) + (n-2) + \cdots + 1 = \frac 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: :P^\mathrmQP = \begin R_1 & & \\ & \ddots & \\ & & R_k \end\ (n\text),\ P^\mathrmQP = \begin R_1 & & & \\ & \ddots & & \\ & & R_k & \\ & & & 1 \end\ (n\text). 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 :P^\mathrmQP = \begin \beginR_1 & & \\ & \ddots & \\ & & R_k\end & 0 \\ 0 & \begin\pm 1 & & \\ & \ddots & \\ & & \pm 1\end \\ \end, The matrices give conjugate pairs of eigenvalues lying on the unit circle in the complex number, complex plane; so this decomposition confirms that all Eigenvalues and eigenvectors, 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 :Q^\mathrm Q = I yields :\dot^\mathrm Q + Q^\mathrm \dot = 0 Evaluation at () then implies :\dot^\mathrm = -\dot . In Lie group terms, this means that the Lie algebra of an orthogonal matrix group consists of skew-symmetric matrix, 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 : \Omega = \begin 0 & -z\theta & y\theta \\ z\theta & 0 & -x\theta \\ -y\theta & x\theta & 0 \end . The exponential of this is the orthogonal matrix for rotation around axis by angle ; setting , , : \exp(\Omega) = \begin 1 - 2s^2 + 2x^2 s^2 & 2xy s^2 - 2z sc & 2xz s^2 + 2y sc\\ 2xy s^2 + 2z sc & 1 - 2s^2 + 2y^2 s^2 & 2yz s^2 - 2x sc\\ 2xz s^2 - 2y sc & 2yz s^2 + 2x sc & 1 - 2s^2 + 2z^2 s^2 \end .

Numerical linear algebra


Numerical analysis takes advantage of many of the properties of orthogonal matrices for numerical linear algebra, and they arise naturally. For example, it is often desirable to compute an orthonormal basis for a space, or an orthogonal change of bases; both take the form of orthogonal matrices. Having determinant ±1 and all eigenvalues of magnitude 1 is of great benefit for numeric stability. One implication is that the condition number is 1 (which is the minimum), so errors are not magnified when multiplying with an orthogonal matrix. Many algorithms use orthogonal matrices like Householder reflections and Givens rotations for this reason. It is also helpful that, not only is an orthogonal matrix invertible, but its inverse is available essentially free, by exchanging indices. Permutations are essential to the success of many algorithms, including the workhorse Gaussian elimination with Pivot element#Partial and complete pivoting, partial pivoting (where permutations do the pivoting). However, they rarely appear explicitly as matrices; their special form allows more efficient representation, such as a list of indices. Likewise, algorithms using Householder and Givens matrices typically use specialized methods of multiplication and storage. For example, a Givens rotation affects only two rows of a matrix it multiplies, changing a full matrix multiplication, multiplication of order to a much more efficient order . When uses of these reflections and rotations introduce zeros in a matrix, the space vacated is enough to store sufficient data to reproduce the transform, and to do so robustly. (Following , we do ''not'' store a rotation angle, which is both expensive and badly behaved.)


A number of important matrix decompositions involve orthogonal matrices, including especially: ;QR decomposition, decomposition : , orthogonal, upper triangular ;Singular value decomposition : , and orthogonal, diagonal matrix ;Eigendecomposition of a matrix, Eigendecomposition of a symmetric matrix (decomposition according to the spectral theorem) : , symmetric, orthogonal, diagonal ;Polar decomposition : , orthogonal, symmetric positive-semidefinite


Consider an overdetermined system of linear equations, as might occur with repeated measurements of a physical phenomenon to compensate for experimental errors. Write , where is , . A decomposition reduces to upper triangular . For example, if is then has the form :R = \begin \cdot & \cdot & \cdot \\ 0 & \cdot & \cdot \\ 0 & 0 & \cdot \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end. The linear least squares (mathematics), linear least squares problem is to find the that minimizes , which is equivalent to projecting to the subspace spanned by the columns of . Assuming the columns of (and hence ) are independent, the projection solution is found from . Now is square () and invertible, and also equal to . But the lower rows of zeros in are superfluous in the product, which is thus already in lower-triangular upper-triangular factored form, as in Gaussian elimination (Cholesky decomposition). Here orthogonality is important not only for reducing to , but also for allowing solution without magnifying numerical problems. In the case of a linear system which is underdetermined, or an otherwise non-invertible matrix, singular value decomposition (SVD) is equally useful. With factored as , a satisfactory solution uses the Moore-Penrose pseudoinverse, , where merely replaces each non-zero diagonal entry with its reciprocal. Set to . The case of a square invertible matrix also holds interest. Suppose, for example, that is a rotation matrix which has been computed as the composition of numerous twists and turns. Floating point does not match the mathematical ideal of real numbers, so has gradually lost its true orthogonality. A Gram–Schmidt process could orthogonalization, orthogonalize the columns, but it is not the most reliable, nor the most efficient, nor the most invariant method. The polar decomposition factors a matrix into a pair, one of which is the unique ''closest'' orthogonal matrix to the given matrix, or one of the closest if the given matrix is singular. (Closeness can be measured by any matrix norm invariant under an orthogonal change of basis, such as the spectral norm or the Frobenius norm.) For a near-orthogonal matrix, rapid convergence to the orthogonal factor can be achieved by a "Newton's method" approach due to (#CITEREFHigham1990, 1990), repeatedly averaging the matrix with its inverse transpose. has published an accelerated method with a convenient convergence test. For example, consider a non-orthogonal matrix for which the simple averaging algorithm takes seven steps :\begin3 & 1\\7 & 5\end \rightarrow \begin1.8125 & 0.0625\\3.4375 & 2.6875\end \rightarrow \cdots \rightarrow \begin0.8 & -0.6\\0.6 & 0.8\end and which acceleration trims to two steps (with = 0.353553, 0.565685). :\begin3 & 1\\7 & 5\end \rightarrow \begin1.41421 & -1.06066\\1.06066 & 1.41421\end \rightarrow \begin0.8 & -0.6\\0.6 & 0.8\end Gram-Schmidt yields an inferior solution, shown by a Frobenius distance of 8.28659 instead of the minimum 8.12404. :\begin3 & 1\\7 & 5\end \rightarrow \begin0.393919 & -0.919145\\0.919145 & 0.393919\end


Some numerical applications, such as Monte Carlo methods and exploration of high-dimensional data spaces, require generation of uniform distribution (continuous), uniformly distributed random orthogonal matrices. In this context, "uniform" is defined in terms of Haar measure, which essentially requires that the distribution not change if multiplied by any freely chosen orthogonal matrix. Orthogonalizing matrices with statistical independence, independent uniformly distributed random entries does not result in uniformly distributed orthogonal matrices, but the QR decomposition, decomposition of independent normal distribution, normally distributed random entries does, as long as the diagonal of contains only positive entries . replaced this with a more efficient idea that later generalized as the "subgroup algorithm" (in which form it works just as well for permutations and rotations). To generate an orthogonal matrix, take an one and a uniformly distributed unit vector of dimension . Construct a Householder reflection from the vector, then apply it to the smaller matrix (embedded in the larger size with a 1 at the bottom right corner).

Nearest orthogonal matrix

The problem of finding the orthogonal matrix nearest a given matrix is related to the Orthogonal Procrustes problem. There are several different ways to get the unique solution, the simplest of which is taking the singular value decomposition of and replacing the singular values with ones. Another method expresses the explicitly but requires the use of a matrix square root: :Q = M \left(M^\mathrm M\right)^ This may be combined with the Babylonian method for extracting the square root of a matrix to give a recurrence which converges to an orthogonal matrix quadratically: :Q_ = 2 M \left(Q_n^ M + M^\mathrm Q_n\right)^ where . These iterations are stable provided the condition number of is less than three."Newton's Method for the Matrix Square Root"
, Nicholas J. Higham, Mathematics of Computation, Volume 46, Number 174, 1986. Using a first-order approximation of the inverse and the same initialization results in the modified iteration: :N_ = Q_n^\mathrm Q_n :P_ = \frac 1 2 Q_n N_ :Q_ = 2 Q_n + P_n N_n - 3 P_n

Spin and pin

A subtle technical problem afflicts some uses of orthogonal matrices. Not only are the group components with determinant +1 and −1 not Connected space, connected to each other, even the +1 component, , is not simply connected space, simply connected (except for SO(1), which is trivial). Thus it is sometimes advantageous, or even necessary, to work with a covering map, covering group of SO(''n''), the spinor group, spin group, . Likewise, has covering groups, the pin groups, Pin(''n''). For , Spin(''n'') is simply connected and thus the universal covering group for . By far the most famous example of a spin group is , which is nothing but , or the group of unit quaternions. The Pin and Spin groups are found within Clifford algebras, which themselves can be built from orthogonal matrices.

Rectangular matrices

If is not a square matrix, then the conditions and are not equivalent. The condition says that the columns of ''Q'' are orthonormal. This can only happen if is an matrix with (due to linear dependence). Similarly, says that the rows of are orthonormal, which requires . There is no standard terminology for these matrices. They are variously called "semi-orthogonal matrices", "orthonormal matrices", "orthogonal matrices", and sometimes simply "matrices with orthonormal rows/columns".

See also

*Symplectic matrix



* * * * *

* * *

External links

Tutorial and Interactive Program on Orthogonal Matrix
{{Matrix classes Matrices