Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Orthogonal Matrices


Test QᵀQ = I, read the determinant, watch lengths and angles survive, and identify the rotation or reflection.

Preset?A square matrix is orthogonal when its columns are orthonormal: unit length and mutually perpendicular, which is the single equation QᵀQ = I. Then Q⁻¹ = Qᵀ, the rows are orthonormal too, det Q = ±1, and Q preserves every length and angle: |Qx| = |x| and (Qx)·(Qy) = x·y. In the plane an orthogonal matrix is a rotation (det +1) or a reflection (det −1); in space a rotation about an axis, or a rotation combined with a reflection.
Size
Q2× 2
Entries of Q
Test vector x
Q2×2
0.866
−0.5
0.5
0.866
Step 1 / 7

Step explanations

1Is this 2×2 matrix orthogonal?
A matrix is orthogonal when its columns are orthonormal — each of length 1, each pair perpendicular — which is the single matrix equation QᵀQ = I. The test is one multiplication. If it passes, everything else follows: Q⁻¹ = Qᵀ, det Q = ±1, and Q moves vectors without changing any length or angle, so it is a rotation, a reflection, or a combination.
Orthonormal columns in one equation: QᵀQ = I. Learn more about the test · what it is








Key Terms

Orthogonal matrix — a square matrix QQ with QTQ=IQ^TQ = I; equivalently, its columns are orthonormal.

Orthonormal — unit length and mutually perpendicular.

Inverse equals transposeQ1=QTQ^{-1} = Q^T, so QQT=IQQ^T = I too and the rows are orthonormal as well.

Isometry — a map preserving lengths: Qx=x\|Q\mathbf{x}\| = \|\mathbf{x}\|; orthogonal matrices also preserve dot products and angles.

Determinant ±1\pm 1+1+1 for a rotation (orientation preserved), 1-1 for a reflection (orientation reversed).

Rotation — in the plane, R(θ)R(\theta); in space, a turn by θ\theta about an axis, the fixed direction with Qu=uQ\mathbf{u} = \mathbf{u}.

Reflection — in the plane, across a line; in space, across a plane; a Householder matrix I2uuT/uTuI - 2\mathbf{u}\mathbf{u}^T/\mathbf{u}^T\mathbf{u} reflects across the plane perpendicular to u\mathbf{u}.

Permutation matrix — reorders coordinates; always orthogonal.

Orthogonal group O(n)O(n) — all n×nn \times n orthogonal matrices; closed under products and inverses.

Getting Started with the Visualizer

Choose a matrix and test it.

• Use the Preset pills for eight matrices: a 30°30° rotation, a reflection, a permutation, a Householder reflection, a rotation about the zz-axis, a matrix with perpendicular but non-unit columns, a scaled rotation, and a shear
• Use the Size stepper for 2×22 \times 2 or 3×33 \times 3, and Shuffle for a random rotation or reflection
• Edit any entry directly; the entries are shown to four decimals, and the test tolerates that rounding
• Change the test vector x\mathbf{x} to see lengths and dot products preserved for your own vector
• Hover the ? icon for a reminder of what orthogonality means and implies
• Press play or step manually; the step log on the right keeps every stage

A matrix that fails the test stops early, with the diagnosis: perpendicular columns of the wrong length, which normalizing fixes, or columns that are not perpendicular at all.

The Scenes in Order

The visualizer follows the textbook checks exactly.

QTQQ^TQ — computed as a product; the diagonal entries are the squared column lengths, the off-diagonal ones the dot products between columns
Not orthogonal — the run stops, showing the normalized matrix when only the lengths were wrong
Determinant±1\pm 1, with the rotation-or-reflection verdict
Lengths and anglesQxQ\mathbf{x} and QyQ\mathbf{y} for two test vectors, with Qx=x\|Q\mathbf{x}\| = \|\mathbf{x}\| and (Qx)(Qy)=xy(Q\mathbf{x})\cdot(Q\mathbf{y}) = \mathbf{x}\cdot\mathbf{y}
InverseQQT=IQQ^T = I, so Q1=QTQ^{-1} = Q^T and the rows are orthonormal too
Classify — in 2D, the rotation angle or the mirror line; in 3D, the axis from the null space of QIQ - I and the angle from the trace
Done — the summary and the group properties

The Test

The frozen picture below shows QTQQ^TQ for the 30°30° rotation: the identity. Each diagonal entry is a column dotted with itself, 11; each off-diagonal entry is the dot product of the two columns, 00.

One multiplication decides orthogonality.
Qᵀ2×20.8660.5−0.50.866·Q2×20.866−0.50.50.866=QᵀQ2×21001
QᵀQ = I, frozen

The 30° rotation: each diagonal entry is cos² + sin² = 1, each off-diagonal entry is −cos·sin + sin·cos = 0. The columns are orthonormal.

The test packs nn length checks and n(n1)/2n(n-1)/2 perpendicularity checks into one product, and it is exactly the condition that the columns form an orthonormal basis. The same product for a non-orthogonal matrix is still informative: the diagonal reports the squared column lengths and the off-diagonal entries report which pairs of columns are not perpendicular.

For a 2×22 \times 2 matrix the test can be done by eye. The columns (a,c)(a, c) and (b,d)(b, d) must satisfy a2+c2=1a^2 + c^2 = 1, b2+d2=1b^2 + d^2 = 1 and ab+cd=0ab + cd = 0; with a=cosθa = \cos\theta and c=sinθc = \sin\theta the second column is forced to be ±(sinθ,cosθ)\pm(-\sin\theta, \cos\theta), which is the whole classification.

Determinant Plus or Minus One

The frozen picture below shows the determinant of the 30°30° rotation: cos230°+sin230°=1\cos^2 30° + \sin^2 30° = 1.

Orthogonal matrices have determinant ±1\pm 1, and the sign is the difference between a rotation and a reflection.
Q2×20.866−0.50.50.866= 1
det Q = 1, frozen

cos² 30° + sin² 30° = 1: orientation preserved, a rotation. Every orthogonal matrix has determinant +1 or −1.

The determinant is ±1\pm 1 because det(QTQ)=(detQ)2=detI=1\det(Q^TQ) = (\det Q)^2 = \det I = 1. Its sign records orientation: a rotation keeps a counterclockwise triangle counterclockwise, a reflection turns it clockwise. Both keep areas and volumes, since detQ=1|\det Q| = 1.

Rotations alone form a group, SO(n)SO(n), since the product of two determinant-+1+1 matrices has determinant +1+1. Reflections do not: the product of two reflections is a rotation, which is how every rotation of the plane can be built from two mirrors.

Lengths and Angles Survive

The frozen picture below shows the 30°30° rotation applied to x=(2,1)\mathbf{x} = (2, 1) and y=(1,0)\mathbf{y} = (1, 0). Both images have the same lengths as the originals, 5\sqrt{5} and 11, and the same dot product, 22.

Every dot product survives, so every length and every angle does.
Q2×20.866−0.50.50.866x21=Q x1.23211.866,Q2×20.866−0.50.50.866y10=Q y0.8660.5
Lengths and angles, frozen

x = (2, 1) and y = (1, 0) rotated by 30°: |Qx| = |x| = √5, |Qy| = 1, and (Qx)·(Qy) = 2 = x·y. The whole figure turned rigidly.

The one-line proof is (Qx)(Qy)=(Qx)T(Qy)=xTQTQy=xTy(Q\mathbf{x})\cdot(Q\mathbf{y}) = (Q\mathbf{x})^T(Q\mathbf{y}) = \mathbf{x}^TQ^TQ\mathbf{y} = \mathbf{x}^T\mathbf{y}. Because lengths are xx\sqrt{\mathbf{x}\cdot\mathbf{x}} and angles come from cosθ=xy/xy\cos\theta = \mathbf{x}\cdot\mathbf{y} / \|\mathbf{x}\|\|\mathbf{y}\|, everything geometric is preserved. The unit circle maps to itself; the grid maps to a rotated, or reflected, grid of the same squares.

This is what distinguishes orthogonal matrices from all other invertible ones. A general matrix sends the unit circle to an ellipse and changes angles; its singular values measure by how much. An orthogonal matrix has all singular values equal to 11.

The Inverse Is the Transpose

The frozen picture below shows QQT=IQQ^T = I for the 30°30° rotation. The transpose is the rotation by 30°-30°, and it undoes QQ.

QTQ=IQ^TQ = I was the test; QQT=IQQ^T = I comes free, and says the rows are orthonormal too.
Q2×20.866−0.50.50.866·Qᵀ2×20.8660.5−0.50.866=I2×21001
Q Qᵀ = I, frozen

The transpose is the rotation by −30° and undoes Q. Q⁻¹ = Qᵀ, and the rows are orthonormal too.

For a square matrix a left inverse is automatically a right inverse, so QTQ=IQ^TQ = I forces QQT=IQQ^T = I. The practical consequence is enormous: solving Qx=bQ\mathbf{x} = \mathbf{b} is x=QTb\mathbf{x} = Q^T\mathbf{b}, one matrix-vector product, and the condition number is 11, so no error is amplified.

That is why numerical algorithms are built from orthogonal steps. Householder reflections zero out entries below a pivot, Givens rotations zero out one entry at a time, and both leave the rest of the problem exactly as well-conditioned as before.

Reading Off a Reflection

The reflection preset 12(1111)\frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} has determinant 1-1. The frozen picture below shows its classification: with cos2φ=sin2φ=1/2\cos 2\varphi = \sin 2\varphi = 1/\sqrt{2}, the mirror line is at φ=22.5°\varphi = 22.5°.

The direction (cos22.5°,sin22.5°)(\cos 22.5°, \sin 22.5°) is fixed and its perpendicular is reversed.
Q2×20.70710.70710.7071−0.7071
A reflection classified, frozen

det −1 and cos 2φ = sin 2φ = 1/√2: the mirror line is at φ = 22.5°. That direction is fixed, its perpendicular reversed.

A 2×22 \times 2 reflection matrix has the form (cos2φsin2φsin2φcos2φ)\begin{pmatrix} \cos 2\varphi & \sin 2\varphi \\ \sin 2\varphi & -\cos 2\varphi \end{pmatrix}, symmetric, with Q2=IQ^2 = I and eigenvalues +1+1 along the mirror and 1-1 across it. The doubled angle is why a matrix whose entries suggest 45°45° is a reflection across the 22.5°22.5° line.

Reflections are the building blocks of all orthogonal matrices: any orthogonal matrix in nn dimensions is a product of at most nn reflections. Two reflections across lines at angle α\alpha apart compose to a rotation by 2α2\alpha.

The Axis of a Rotation in Space

The permutation matrix that sends (x,y,z)(x, y, z) to (z,x,y)(z, x, y) is orthogonal with determinant +1+1. The frozen picture below shows its classification: the axis, the null space of QIQ - I, is (1,1,1)(1, 1, 1), and the trace 0=1+2cosθ0 = 1 + 2\cos\theta gives θ=120°\theta = 120°.

Cycling three coordinates is a third of a turn about the main diagonal.
Q3×3001100010
A rotation of space classified, frozen

The permutation (x, y, z) → (z, x, y): axis (1, 1, 1) from the null space of Q − I, and trace 0 = 1 + 2 cos θ gives θ = 120°.

Euler's theorem says every rotation of space has an axis, a line of fixed points. Algebraically, QQ has determinant +1+1 and eigenvalues of modulus 11, so one eigenvalue is real and equal to 11, and its eigenvector is the axis. The other two are e±iθe^{\pm i\theta}, and adding all three gives trQ=1+2cosθ\operatorname{tr} Q = 1 + 2\cos\theta, which fixes the angle up to sign.

The Householder preset shows the determinant 1-1 case: eigenvalue 1-1 along the normal (1,1,1)(1, 1, 1), which is reversed, and eigenvalue 11 twice on the plane x+y+z=0x + y + z = 0, which is fixed. A pure reflection across a plane.

Perpendicular but Not Unit

The matrix (1111)\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} has perpendicular columns of length 2\sqrt{2}: QTQ=2IQ^TQ = 2I, not II. The frozen picture below shows the diagnosis and the fix, each column divided by 2\sqrt{2}.

The normalized matrix is the reflection preset.
Q2×2111−12×20.70710.70710.7071−0.7071
Perpendicular, not unit, frozen

Columns (1, 1) and (1, −1) are perpendicular but of length √2, so QᵀQ = 2I. Dividing each column by √2 gives an orthogonal matrix - the reflection preset.

This is the most common way to be almost orthogonal, and the easiest to repair: Gram–Schmidt's final step is exactly this normalization. The scaled-rotation preset is the same situation, QTQ=4IQ^TQ = 4I with columns of length 22, and dividing by 22 recovers the rotation.

Columns that are not perpendicular, as in the shear preset, cannot be repaired by rescaling. Gram–Schmidt would produce an orthonormal basis of the same column space, but the result is a different matrix, and the original was simply not orthogonal.

Reading the Scene Player

Each scene shows the matrices for one check with the arithmetic in the caption.

• In QTQQ^TQ and QQTQQ^T the diagonal is the target when the product is the identity; entries that spoil it are muted
• The test vectors and their images share colours: x\mathbf{x} and QxQ\mathbf{x} accent, y\mathbf{y} and QyQ\mathbf{y} secondary
• In the determinant scene the matrix is drawn between bars, with the diagonal accent for +1+1 and muted for 1-1
• The classification scene colours the whole matrix accent for a rotation and secondary for a reflection
• Entries are shown to four decimals since rotations involve sines and cosines

Choosing a Matrix

The eight presets each make a different point.

Rotation 30°30°(cos30°sin30°sin30°cos30°)\begin{pmatrix} \cos 30° & -\sin 30° \\ \sin 30° & \cos 30° \end{pmatrix}, determinant +1+1, angle read from the first column
Reflection12(1111)\frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}, determinant 1-1, the mirror at 22.5°22.5°
Permutation — cyclic shift of coordinates; a rotation by 120°120° about (1,1,1)(1, 1, 1)
HouseholderI23uuTI - \frac{2}{3}\mathbf{u}\mathbf{u}^T with u=(1,1,1)\mathbf{u} = (1, 1, 1); a reflection of space across the plane x+y+z=0x + y + z = 0
Rotation about zz90°90° about the zz-axis; the axis is found as the null space of QIQ - I
Orthogonal, not unit(1111)\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}; the columns are perpendicular but of length 2\sqrt{2}, and the tool shows the normalized version
Scaled rotation — twice a 45°45° rotation; angles are kept but lengths double, and QTQ=4IQ^TQ = 4I
Shear — columns not perpendicular; no rescaling helps

Shuffle produces a random rotation or reflection by multiples of 30°30°, combined with a signed permutation in 3D.

What an Orthogonal Matrix Is

A square matrix QQ is orthogonal when its columns q1,,qn\mathbf{q}_1, \ldots, \mathbf{q}_n are orthonormal: qiqj=1\mathbf{q}_i\cdot\mathbf{q}_j = 1 if i=ji = j and 00 otherwise. Since entry (i,j)(i, j) of QTQQ^TQ is exactly qiqj\mathbf{q}_i\cdot\mathbf{q}_j, the condition is the single equation

QTQ=IQ^TQ = I


For a square matrix a one-sided inverse is the inverse, so Q1=QTQ^{-1} = Q^T and also QQT=IQQ^T = I, which says the rows are orthonormal too. Taking determinants, (detQ)2=1(\det Q)^2 = 1, so detQ=±1\det Q = \pm 1.

The geometric content is that QQ preserves the dot product: (Qx)(Qy)=xTQTQy=xy(Q\mathbf{x})\cdot(Q\mathbf{y}) = \mathbf{x}^TQ^TQ\mathbf{y} = \mathbf{x}\cdot\mathbf{y}. Lengths and angles are dot products, so QQ moves every figure rigidly, without stretching or distorting; it is an isometry fixing the origin. Conversely every linear isometry is orthogonal.

In the plane there are two kinds. Determinant +1+1 gives a rotation (cosθsinθsinθcosθ)\begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}; determinant 1-1 gives a reflection (cos2φsin2φsin2φcos2φ)\begin{pmatrix} \cos 2\varphi & \sin 2\varphi \\ \sin 2\varphi & -\cos 2\varphi \end{pmatrix} across the line at angle φ\varphi. In space, determinant +1+1 is a rotation about an axis, the direction u\mathbf{u} with Qu=uQ\mathbf{u} = \mathbf{u}, by an angle with trQ=1+2cosθ\operatorname{tr} Q = 1 + 2\cos\theta; determinant 1-1 is a reflection across a plane, possibly combined with a rotation about the plane's normal.

Orthogonal matrices are closed under multiplication and inversion, forming the orthogonal group, and they are the reason so much of linear algebra is numerically safe: a change of basis by an orthogonal matrix amplifies no error. The spectral decomposition, QR and the SVD are all built from them. For the theory, see the orthogonal sets page and the geometric transformations page.

Key Properties

Facts that hold for every orthogonal matrix QQ.

QTQ=QQT=IQ^TQ = QQ^T = I and Q1=QTQ^{-1} = Q^T; both columns and rows are orthonormal
detQ=±1\det Q = \pm 1: rotation or reflection
Isometry: Qx=x\|Q\mathbf{x}\| = \|\mathbf{x}\|, (Qx)(Qy)=xy(Q\mathbf{x})\cdot(Q\mathbf{y}) = \mathbf{x}\cdot\mathbf{y}, angles preserved
Eigenvalues have modulus 11: real ones are ±1\pm 1, the rest are conjugate pairs e±iθe^{\pm i\theta}
Group: products and inverses of orthogonal matrices are orthogonal; QTQ^T and Q1Q^{-1} are orthogonal
Condition number 11: the best possible; solving Qx=bQ\mathbf{x} = \mathbf{b} is a transpose
Every orthonormal basis is the column set of an orthogonal matrix, and changing to it is a rigid motion
Symmetric orthogonal matrices are reflections: Q2=IQ^2 = I, eigenvalues ±1\pm 1
Permutation matrices and ±1\pm 1 diagonal matrices are orthogonal
Unitary matrices are the complex counterpart, with QQ=IQ^*Q = I

Why It Matters

Orthogonal matrices are the rigid motions, and the tools of numerical linear algebra.

Geometry and graphics: rotations of objects, cameras and coordinate frames are orthogonal matrices, composed by multiplication and undone by transposition
Numerical stability: QR factorization, Householder and Givens methods, the QR algorithm for eigenvalues and the SVD all work by orthogonal transformations because they never amplify rounding error
Spectral decomposition: a symmetric matrix is QΛQTQ\Lambda Q^T; the change to its eigenvector basis is orthogonal
Least squares: with orthonormal columns the normal equations reduce to x^=QTb\hat{\mathbf{x}} = Q^T\mathbf{b}
Signal processing: the discrete Fourier, cosine and wavelet transforms are orthogonal (or unitary), which is why they preserve energy and invert by transposition
Statistics: orthogonal rotations of factor loadings, and orthogonal designs
Physics and robotics: rotation groups SO(2)SO(2) and SO(3)SO(3), Euler angles, and the axis–angle form read from the trace

Worked Example

Take the default preset, the rotation by 30°30°,

Q=(cos30°sin30°sin30°cos30°)=(0.8660.50.50.866)Q = \begin{pmatrix} \cos 30° & -\sin 30° \\ \sin 30° & \cos 30° \end{pmatrix} = \begin{pmatrix} 0.866 & -0.5 \\ 0.5 & 0.866 \end{pmatrix}


Test. QTQQ^TQ has diagonal entries cos230°+sin230°=1\cos^2 30° + \sin^2 30° = 1 and off-diagonal entries cos30°sin30°+sin30°cos30°=0-\cos 30°\sin 30° + \sin 30°\cos 30° = 0: the identity. Orthogonal.

Determinant. cos230°+sin230°=1\cos^2 30° + \sin^2 30° = 1: a rotation.

Lengths. For x=(2,1)\mathbf{x} = (2, 1), Qx=(1.232,1.866)Q\mathbf{x} = (1.232, 1.866) and Qx2=1.518+3.482=5=x2\|Q\mathbf{x}\|^2 = 1.518 + 3.482 = 5 = \|\mathbf{x}\|^2. For y=(1,0)\mathbf{y} = (1, 0), Qy=(0.866,0.5)Q\mathbf{y} = (0.866, 0.5), and (Qx)(Qy)=1.067+0.933=2=xy(Q\mathbf{x})\cdot(Q\mathbf{y}) = 1.067 + 0.933 = 2 = \mathbf{x}\cdot\mathbf{y}.

Inverse. QT=(0.8660.50.50.866)Q^T = \begin{pmatrix} 0.866 & 0.5 \\ -0.5 & 0.866 \end{pmatrix} is the rotation by 30°-30°, and QQT=IQQ^T = I.

Classify. cosθ=0.866\cos\theta = 0.866 and sinθ=0.5\sin\theta = 0.5 give θ=30°\theta = 30°. The eigenvalues are e±i30°e^{\pm i\,30°}, complex, so no real direction is fixed.

For contrast, the reflection preset 12(1111)\frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} also passes the test but has determinant 1-1; with cos2φ=sin2φ=1/2\cos 2\varphi = \sin 2\varphi = 1/\sqrt{2} the mirror is at φ=22.5°\varphi = 22.5°, and the direction (cos22.5°,sin22.5°)(\cos 22.5°, \sin 22.5°) is fixed while its perpendicular is reversed.

Common Mistakes

A few mistakes recur.

Perpendicular columns without unit length(1111)\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} has orthogonal columns but is not an orthogonal matrix; the name refers to orthonormal columns
Checking only detQ=±1\det Q = \pm 1 — many non-orthogonal matrices have determinant ±1\pm 1, such as a shear; the test is QTQ=IQ^TQ = I
Reading a reflection as a rotation — both preserve lengths; only the sign of the determinant tells them apart
Confusing the rotation angle with the eigenvalue argument in 3D — the angle comes from trQ=1+2cosθ\operatorname{tr} Q = 1 + 2\cos\theta, not from any single entry
Assuming QT=QQ^T = Q — only symmetric orthogonal matrices, the reflections, satisfy this; a rotation's transpose is the opposite rotation
Non-square matrices with orthonormal columns — they satisfy QTQ=IQ^TQ = I but not QQT=IQQ^T = I, and are not called orthogonal matrices
Expecting real eigenvectors — a rotation of the plane by anything but 0° or 180°180° has none