← Module 03 / Understanding matrices

Lesson 03.4 · §3.9

Which matrices preserve length and angle?

Derive orthogonal matrix identities and prove preservation of inner products.

In this lesson 4 ideas
  1. Turn without stretching
  2. Source derivation: preserve the product first
  3. Explore in three dimensions
  4. Transfer

Source scope: §3.9. Worked numerical examples, experiments, and practice are teaching supplements unless identified as source results.

Turn without stretching

A quarter turn sends (2,1)(2,1) to (−1,2)(-1,2). Both lengths are 5\sqrt5. Its matrix Q=[0−110]Q=\begin{bmatrix}0&-1\\1&0\end{bmatrix} has orthogonal columns of unit length.

A square matrix Q∈Rn×nQ\in\mathbb R^{n\times n} is orthogonal when its columns are pairwise orthonormal. Entry (i,j)(i,j) of QTQQ^TQ is the inner product of columns i,ji,j, so

QTQ=QQT=I,QT=Q−1.Q^TQ=QQ^T=I,\qquad Q^T=Q^{-1}.

The square assumption matters. A rectangular matrix with orthonormal columns satisfies UTU=IU^TU=I, but UUTUU^T can be a projection rather than the identity.

Source derivation: preserve the product first

For all x,y∈Rnx,y\in\mathbb R^n,

(Qx)T(Qy)=xTQTQy=xTIy=xTy.(Qx)^T(Qy)=x^TQ^TQy=x^TIy=x^Ty.

Setting y=xy=x and taking square roots gives

∥Qx∥2=(Qx)T(Qx)=xTx=∥x∥2.\|Qx\|_2=\sqrt{(Qx)^T(Qx)}=\sqrt{x^Tx}=\|x\|_2.

For nonzero inputs, both the dot product and lengths are unchanged, so the cosine of their angle is unchanged. Orthogonal maps may rotate or reflect about the origin. A reflection diag⁡(1,−1)\operatorname{diag}(1,-1) has determinant negative one and still preserves length. A translation preserves distances too, but it is not multiplication by an orthogonal matrix because it moves zero.

Explore it yourself

Turn a unit vector

Predict the quadratic value before aligning x with an eigenvector.

Preparing interactive controls…

x₁x₂-4-4-3-3-2-2-1-1011223344q₁q₂xAx

A = [[2.500, 0.866], [0.866, 1.500]]. xᵀAx = R(x) = 3.000; bounds [1, 3]. trace = 4.000; determinant = 3.000. Positive definite.

Axes: first and second real coordinates, in unit steps. Endpoints and labels identify each vector.

Explore in three dimensions

Explore it yourself

Move a solid without stretching it

Change the mathematical rotation or reflection. Compare lengths and inner products before and after.

Preparing interactive controls…

Teaching supplement · interactive 3D projection · one grid interval = one coordinate unit

xyQxQyxyz0

Change the mathematics

Qx = (0.819, 0.574, 1.000); Qy = (-0.574, 0.819, 1.000). ‖x‖ = 1.414 = ‖Qx‖ 1.414; ‖y‖ = 1.414 = ‖Qy‖ 1.414. x·y = 1.000 = Qx·Qy 1.000. Angle = 60° before and after. det Q = 1.

Dashed vectors show the inputs; solid vectors show their images. This rotation changes the mathematical outputs. The separate camera controls change only the view. A reflection reverses orientation while preserving lengths and angles.

Camera controls · change only the view

Drag the diagram with a mouse, or use these sliders with a keyboard or touch. Projection can make perpendicular directions look oblique; the coordinate readout is unchanged.

Red: input or first direction. Blue: second direction or reference. Green: result. Amber: residual, normal, or third direction. Labels distinguish overlapping objects.

Transfer

Is 2I2I orthogonal because its columns are perpendicular?

Check the lengths too

No. Its column lengths are two and (2I)T(2I)=4I(2I)^T(2I)=4I. Orthogonal matrices require orthonormal columns, not just perpendicular columns.