OrthogonalMatrixQ
✖
OrthogonalMatrixQ
Details and Options

- A p×q matrix m is orthogonal if p≥q and Transpose[m].m is the q×q identity matrix, or p≤q and m.Transpose[m] is the p×p identity matrix.
- OrthogonalMatrixQ works for symbolic as well as numerical matrices.
- The following options can be given:
-
Normalized True test if matrix columns are normalized SameTest Automatic function to test equality of expressions Tolerance Automatic tolerance for approximate numbers - For exact and symbolic matrices, the option SameTest->f indicates that two entries aij and bij are taken to be equal if f[aij,bij] gives True.
- For approximate matrices, the option Tolerance->t can be used to indicate that the norm γ=m.mT-In∞ satisfying γ≤t is taken to be zero where In is the identity matrix.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Test if a 2×2 numeric matrix is orthogonal:

https://wolfram.com/xid/0k78i272w3cub-778hz

Test if a 3×3 symbolic matrix is orthogonal:

https://wolfram.com/xid/0k78i272w3cub-0cn4lt

https://wolfram.com/xid/0k78i272w3cub-yrubs


https://wolfram.com/xid/0k78i272w3cub-n1jyjq

Scope (14)Survey of the scope of standard use cases
Basic Uses (6)
Test if a real matrix is orthogonal:

https://wolfram.com/xid/0k78i272w3cub-8x0gr

https://wolfram.com/xid/0k78i272w3cub-icv31x

A real orthogonal matrix is also unitary:

https://wolfram.com/xid/0k78i272w3cub-btxk75

Test if a complex matrix is orthogonal:

https://wolfram.com/xid/0k78i272w3cub-fivtv

https://wolfram.com/xid/0k78i272w3cub-xqht5i


https://wolfram.com/xid/0k78i272w3cub-pvc665

A complex-valued orthogonal matrix is not unitary:

https://wolfram.com/xid/0k78i272w3cub-h9wdb5

Test if an exact matrix is orthogonal:

https://wolfram.com/xid/0k78i272w3cub-fhbhm1

https://wolfram.com/xid/0k78i272w3cub-d0yz6j


https://wolfram.com/xid/0k78i272w3cub-ch9lf9

Use OrthogonalMatrixQ with arbitrary-precision matrix:

https://wolfram.com/xid/0k78i272w3cub-h89ze5

A random matrix is typically not orthogonal:

https://wolfram.com/xid/0k78i272w3cub-e792ql

Use OrthogonalMatrixQ with a symbolic matrix:

https://wolfram.com/xid/0k78i272w3cub-hsnikq

The matrix becomes orthogonal when and
:

https://wolfram.com/xid/0k78i272w3cub-fndu0i

OrthogonalMatrixQ works efficiently with large numerical matrices:

https://wolfram.com/xid/0k78i272w3cub-bjhh1d

https://wolfram.com/xid/0k78i272w3cub-n2hz99


https://wolfram.com/xid/0k78i272w3cub-pcc5uf

Special Matrices (4)
Use OrthogonalMatrixQ with sparse matrices:

https://wolfram.com/xid/0k78i272w3cub-dzato4


https://wolfram.com/xid/0k78i272w3cub-k0o9yj

Use OrthogonalMatrixQ with structured matrices:

https://wolfram.com/xid/0k78i272w3cub-fyaetx


https://wolfram.com/xid/0k78i272w3cub-c0k3bb

The identity matrix is orthogonal:

https://wolfram.com/xid/0k78i272w3cub-kkhgb9

HilbertMatrix is not orthogonal:

https://wolfram.com/xid/0k78i272w3cub-ou7ra

Rectangular Semi-orthogonal Matrices (4)
Test if a rectangular matrix is semi-orthogonal:

https://wolfram.com/xid/0k78i272w3cub-rcfi0v

https://wolfram.com/xid/0k78i272w3cub-6me35r

As there are more columns than rows, this indicates that the rows are orthonormal:

https://wolfram.com/xid/0k78i272w3cub-lgc2fq

The columns are not orthonormal:

https://wolfram.com/xid/0k78i272w3cub-8oenkk

Test a matrix with more rows than columns:

https://wolfram.com/xid/0k78i272w3cub-t6psi4

https://wolfram.com/xid/0k78i272w3cub-pbetwd

The columns of the matrix are orthonormal:

https://wolfram.com/xid/0k78i272w3cub-odejr9


https://wolfram.com/xid/0k78i272w3cub-2ar6bl

Generate a random orthogonal matrix:

https://wolfram.com/xid/0k78i272w3cub-obzphs

https://wolfram.com/xid/0k78i272w3cub-zyuij7

Any subset of its rows forms a rectangular semi-orthogonal matrix:

https://wolfram.com/xid/0k78i272w3cub-lcf25m

As does any subset of its columns:

https://wolfram.com/xid/0k78i272w3cub-mbm0y0

Rectangular identity matrices are semi-orthogonal:

https://wolfram.com/xid/0k78i272w3cub-3ofdc6

Options (4)Common values & functionality for each option
Normalized (2)
Symbolic orthogonal matrix columns are often not normalized to 1:

https://wolfram.com/xid/0k78i272w3cub-2cudn6

Avoid testing if the columns are normalized:

https://wolfram.com/xid/0k78i272w3cub-m3uykr

Multiply the second column of an orthogonal matrix by 2:

https://wolfram.com/xid/0k78i272w3cub-g0tium

OrthogonalMatrixQ with NormalizedFalse will still give True for m:

https://wolfram.com/xid/0k78i272w3cub-107igw

However, it will not give true for Transpose[m]:

https://wolfram.com/xid/0k78i272w3cub-jgxt36

This is because is a diagonal matrix, but
is not:

https://wolfram.com/xid/0k78i272w3cub-7qnrk6

SameTest (1)
This matrix is orthogonal for a positive real , but OrthogonalMatrixQ gives False:

https://wolfram.com/xid/0k78i272w3cub-y9f0bt

https://wolfram.com/xid/0k78i272w3cub-ej0bsf

Use the option SameTest to get the correct answer:

https://wolfram.com/xid/0k78i272w3cub-63zf1y

Tolerance (1)
Generate an orthogonal real-valued matrix with some random perturbation of order 10-13:

https://wolfram.com/xid/0k78i272w3cub-35lu76

https://wolfram.com/xid/0k78i272w3cub-mrsvrl

q.q is not exactly zero outside the main diagonal:

https://wolfram.com/xid/0k78i272w3cub-u3ld0

Adjust the option Tolerance for accepting the matrix as orthogonal:

https://wolfram.com/xid/0k78i272w3cub-cbjh4n

Tolerance is applied to the following value:

https://wolfram.com/xid/0k78i272w3cub-dvs1sp

Applications (10)Sample problems that can be solved with this function
Sources of Orthogonal Matrices (5)
Any orthonormal basis for forms an orthogonal matrix:

https://wolfram.com/xid/0k78i272w3cub-trp7ow

https://wolfram.com/xid/0k78i272w3cub-9iusz3

Putting the basis vectors in rows of a matrix forms an orthogonal matrix:

https://wolfram.com/xid/0k78i272w3cub-b78vlp

Putting them in columns also gives an orthogonal matrix:

https://wolfram.com/xid/0k78i272w3cub-vx53br

Orthogonalize applied to real, linearly independent vectors generates an orthogonal matrix:

https://wolfram.com/xid/0k78i272w3cub-fjlojg

https://wolfram.com/xid/0k78i272w3cub-yv0wgm

The matrix does not need to be square, in which case the resulting matrix is semi-orthogonal:

https://wolfram.com/xid/0k78i272w3cub-itqf5y

https://wolfram.com/xid/0k78i272w3cub-m9aj3m


https://wolfram.com/xid/0k78i272w3cub-ptc79

https://wolfram.com/xid/0k78i272w3cub-2mwa78

But the starting matrix must have full rank:

https://wolfram.com/xid/0k78i272w3cub-u98jzm

https://wolfram.com/xid/0k78i272w3cub-dx6nip


https://wolfram.com/xid/0k78i272w3cub-3jr3cu

Any rotation matrix is orthogonal:

https://wolfram.com/xid/0k78i272w3cub-520xti


https://wolfram.com/xid/0k78i272w3cub-pxf6e3


https://wolfram.com/xid/0k78i272w3cub-8isqwk

Any permutation matrix is orthogonal:

https://wolfram.com/xid/0k78i272w3cub-61a4sg


https://wolfram.com/xid/0k78i272w3cub-liamcq

Matrices drawn from CircularRealMatrixDistribution are orthogonal:

https://wolfram.com/xid/0k78i272w3cub-ewows3

Uses of Orthogonal Matrices (5)
Orthogonal matrices preserve the standard inner product on . In other words, if
is orthogonal and
and
are vectors, then
:

https://wolfram.com/xid/0k78i272w3cub-iu4qc5

This means the angles between the vectors are unchanged:

https://wolfram.com/xid/0k78i272w3cub-k7jgn1

Since the norm is derived from the inner product, norms are preserved as well:

https://wolfram.com/xid/0k78i272w3cub-zxkffs


https://wolfram.com/xid/0k78i272w3cub-fgl9r3

Any orthogonal matrix represents a rotation and/or reflection. If the matrix has determinant , it is a pure rotation. If it the determinant is
, the matrix includes a reflection. Consider the following matrix:

https://wolfram.com/xid/0k78i272w3cub-8m7xfr
It is orthogonal and has determinant :

https://wolfram.com/xid/0k78i272w3cub-5y5w7l

Thus, it is a pure rotation; the Cartesian unit vectors and
maintain their relative positions:

https://wolfram.com/xid/0k78i272w3cub-3t8z4f

The following matrix is orthogonal but has determinant :

https://wolfram.com/xid/0k78i272w3cub-paqrc7

https://wolfram.com/xid/0k78i272w3cub-skt9oh

Thus, it includes a reflection; the Cartesian unit vectors and
reverse their relative positions:

https://wolfram.com/xid/0k78i272w3cub-ciyth5

Orthogonal matrices play an important role in many matrix decompositions:

https://wolfram.com/xid/0k78i272w3cub-r9tp91


https://wolfram.com/xid/0k78i272w3cub-c832e6


https://wolfram.com/xid/0k78i272w3cub-qsnnw8


https://wolfram.com/xid/0k78i272w3cub-qdp8o4

The matrix is always orthogonal for any nonzero real vector
:

https://wolfram.com/xid/0k78i272w3cub-1tb81d

is called a Householder reflection; as a reflection, its determinant is
:

https://wolfram.com/xid/0k78i272w3cub-5l0gij

It represents a reflection through a plane perpendicular to , sending
to
:

https://wolfram.com/xid/0k78i272w3cub-8ufs4r

Any vector perpendicular to is unchanged by
:

https://wolfram.com/xid/0k78i272w3cub-de8r7u

In matrix computations, is used to set to zero selected components of a given column vector
:

https://wolfram.com/xid/0k78i272w3cub-qgpd5k

https://wolfram.com/xid/0k78i272w3cub-dl8zhl

Find the function satisfying the following differential equation:

https://wolfram.com/xid/0k78i272w3cub-ir679w
Represent the cross-product with by means of multiplication by the antisymmetric matrix
:

https://wolfram.com/xid/0k78i272w3cub-c8zk97


https://wolfram.com/xid/0k78i272w3cub-c4d43n


https://wolfram.com/xid/0k78i272w3cub-bowxzy

Compute the exponential and use it to define a solution to the equation:

https://wolfram.com/xid/0k78i272w3cub-jvsabm

Verify that satisfies the differential equation and initial condition:

https://wolfram.com/xid/0k78i272w3cub-b7v35s

The matrix is orthogonal for all values of
:

https://wolfram.com/xid/0k78i272w3cub-d6ex2h

Thus, the orbit of the solution is at a constant distance from the origin, in this case a circle:

https://wolfram.com/xid/0k78i272w3cub-evgkjz

Properties & Relations (14)Properties of the function, and connections to other functions
A matrix is orthogonal if m.Transpose[m]IdentityMatrix[n]:

https://wolfram.com/xid/0k78i272w3cub-cmhn7i

https://wolfram.com/xid/0k78i272w3cub-dtku56

For an approximate matrix, the identity is approximately true:

https://wolfram.com/xid/0k78i272w3cub-f7fesw

https://wolfram.com/xid/0k78i272w3cub-ipxgp4

The inverse of an orthogonal matrix is its transpose:

https://wolfram.com/xid/0k78i272w3cub-f62xc3

https://wolfram.com/xid/0k78i272w3cub-nhow6k

Thus, the inverse and transpose are orthogonal matrices as well:

https://wolfram.com/xid/0k78i272w3cub-1f32s2

A real orthogonal matrix preserves the standard inner product of vectors in :

https://wolfram.com/xid/0k78i272w3cub-8us4rh

As a consequence, real orthogonal matrices preserve norms as well:

https://wolfram.com/xid/0k78i272w3cub-wafapn


https://wolfram.com/xid/0k78i272w3cub-vbbter

Any real-valued orthogonal matrix is unitary:

https://wolfram.com/xid/0k78i272w3cub-0cqhqk

https://wolfram.com/xid/0k78i272w3cub-e9aqp

But a complex unitary matrix is typically not orthogonal:

https://wolfram.com/xid/0k78i272w3cub-dax02

https://wolfram.com/xid/0k78i272w3cub-kqu6f7

Products of orthogonal matrices are orthogonal:

https://wolfram.com/xid/0k78i272w3cub-b9qwnr


https://wolfram.com/xid/0k78i272w3cub-usuyez

A real-valued orthogonal matrix is normal:

https://wolfram.com/xid/0k78i272w3cub-czkuv

https://wolfram.com/xid/0k78i272w3cub-i2xtni

A complex-valued orthogonal matrix need not be normal:

https://wolfram.com/xid/0k78i272w3cub-qiokpc

https://wolfram.com/xid/0k78i272w3cub-b3krp9

Real-valued orthogonal matrices have eigenvalues that lie on the unit circle:

https://wolfram.com/xid/0k78i272w3cub-emyf98

https://wolfram.com/xid/0k78i272w3cub-8cpm

Use Eigenvalues to find eigenvalues:

https://wolfram.com/xid/0k78i272w3cub-ihx8e7

Verify they lie on the unit circle:

https://wolfram.com/xid/0k78i272w3cub-48f29d

This does not apply to complex-valued orthogonal matrices:

https://wolfram.com/xid/0k78i272w3cub-f791n7


https://wolfram.com/xid/0k78i272w3cub-q5tm25

Real orthogonal matrices have a complete set of eigenvectors:

https://wolfram.com/xid/0k78i272w3cub-gas7tm

https://wolfram.com/xid/0k78i272w3cub-fetnrq

As a consequence, they must be diagonalizable:

https://wolfram.com/xid/0k78i272w3cub-74hwjf

Use Eigenvectors to find eigenvectors:

https://wolfram.com/xid/0k78i272w3cub-edsq1a

A complex orthogonal matrix can fail to be diagonalizable:

https://wolfram.com/xid/0k78i272w3cub-jw86td

https://wolfram.com/xid/0k78i272w3cub-n1jofw

The singular values are all 1 for a real orthogonal matrix:

https://wolfram.com/xid/0k78i272w3cub-o7cls4

https://wolfram.com/xid/0k78i272w3cub-qh9d3j


https://wolfram.com/xid/0k78i272w3cub-bpgix3

This need not be true for a complex orthogonal matrix:

https://wolfram.com/xid/0k78i272w3cub-jumjp7

https://wolfram.com/xid/0k78i272w3cub-2ahdn8


https://wolfram.com/xid/0k78i272w3cub-9n61lv

The determinant of an orthogonal matrix is 1 or :

https://wolfram.com/xid/0k78i272w3cub-otnxar

https://wolfram.com/xid/0k78i272w3cub-pycurb

The 2-norm of a real orthogonal matrix is always 1:

https://wolfram.com/xid/0k78i272w3cub-di8pbr

https://wolfram.com/xid/0k78i272w3cub-qw03dp

This need not be true for complex orthogonal matrices:

https://wolfram.com/xid/0k78i272w3cub-idg52u

https://wolfram.com/xid/0k78i272w3cub-ua6ll8

Integer powers of orthogonal matrices are orthogonal:

https://wolfram.com/xid/0k78i272w3cub-uh54mz

https://wolfram.com/xid/0k78i272w3cub-mxkbss


https://wolfram.com/xid/0k78i272w3cub-7qjaps

MatrixExp[m] for real antisymmetric m is both orthogonal and unitary:

https://wolfram.com/xid/0k78i272w3cub-m8xru

https://wolfram.com/xid/0k78i272w3cub-bcyqur

For complex antisymmetric m, the exponential is orthogonal but not, in general, unitary:

https://wolfram.com/xid/0k78i272w3cub-yxovlo

https://wolfram.com/xid/0k78i272w3cub-gda75q

OrthogonalMatrix can be used to explicitly construct orthogonal matrices:

https://wolfram.com/xid/0k78i272w3cub-cr5xbx

These satisfy OrthogonalMatrixQ:

https://wolfram.com/xid/0k78i272w3cub-o0d3a

Possible Issues (1)Common pitfalls and unexpected behavior
OrthogonalMatrixQ uses the definition for both real- and complex-valued matrices:

https://wolfram.com/xid/0k78i272w3cub-qork62

https://wolfram.com/xid/0k78i272w3cub-jnorqo

These complex matrices need not be normal or possess many properties of real orthogonal matrices:

https://wolfram.com/xid/0k78i272w3cub-j4rs3c

UnitaryMatrixQ tests the more common definition that ensures a complex matrix is normal:

https://wolfram.com/xid/0k78i272w3cub-xdwwzp

Alternatively, test if the entries are real to restrict to real orthogonal matrices:

https://wolfram.com/xid/0k78i272w3cub-nql4v5

https://wolfram.com/xid/0k78i272w3cub-vgzldd

Wolfram Research (2014), OrthogonalMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/OrthogonalMatrixQ.html.
Text
Wolfram Research (2014), OrthogonalMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/OrthogonalMatrixQ.html.
Wolfram Research (2014), OrthogonalMatrixQ, Wolfram Language function, https://reference.wolfram.com/language/ref/OrthogonalMatrixQ.html.
CMS
Wolfram Language. 2014. "OrthogonalMatrixQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/OrthogonalMatrixQ.html.
Wolfram Language. 2014. "OrthogonalMatrixQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/OrthogonalMatrixQ.html.
APA
Wolfram Language. (2014). OrthogonalMatrixQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/OrthogonalMatrixQ.html
Wolfram Language. (2014). OrthogonalMatrixQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/OrthogonalMatrixQ.html
BibTeX
@misc{reference.wolfram_2025_orthogonalmatrixq, author="Wolfram Research", title="{OrthogonalMatrixQ}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/OrthogonalMatrixQ.html}", note=[Accessed: 01-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_orthogonalmatrixq, organization={Wolfram Research}, title={OrthogonalMatrixQ}, year={2014}, url={https://reference.wolfram.com/language/ref/OrthogonalMatrixQ.html}, note=[Accessed: 01-April-2025
]}