Orthogonal Transformations & Rotations

1650 words
8 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Orthogonal Transformations & Rotations ## ๐ŸŽฏ Learning Objectives After this topic you will be able to: - Identify orthogonal matrices ($Q^T Q = I$) - Prove that orthogonal transformations preserve lengths and dot products - Recognise rotation and reflection matrices - Compute with orthogonal matrices including $Q^...

Orthogonal Transformations & Rotations

๐ŸŽฏ Learning Objectives

After this topic you will be able to:
  • Identify orthogonal matrices (QTQ=IQ^T Q = I)
  • Prove that orthogonal transformations preserve lengths and dot products
  • Recognise rotation and reflection matrices
  • Compute with orthogonal matrices including Qโˆ’1=QTQ^{-1} = Q^T
  • Understand the determinant of orthogonal matrices (ยฑ1\pm 1)

๐Ÿ“‹ Prerequisites

  • Orthogonality (Week 8) โ€” orthonormal bases
  • Matrix Multiplication (Week 1) โ€” matrix operations
  • Orthogonal transformations are the rigid motions of linear algebra

1. Intuition: Rigid Motions

An orthogonal transformation is a linear map that preserves lengths and angles. In R2\mathbb{R}^2 and R3\mathbb{R}^3, these are exactly rotations and reflections โ€” the transformations that don't stretch or squish space. Imagine a rigid object (like a book) in space. You can rotate it or flip it over, but you can't stretch it. Those operations are orthogonal transformations.

2. Orthogonal Matrices

2.1 Definition

Definition (Orthogonal Matrix). A square nร—nn \times n matrix QQ is orthogonal if:
>QTQ=QQT=In>> Q^T Q = Q Q^T = I_n >
Equivalently, Qโˆ’1=QTQ^{-1} = Q^T. Key properties:
  • Columns of QQ form an orthonormal basis of Rn\mathbb{R}^n
  • Rows of QQ also form an orthonormal basis
  • detโก(Q)=ยฑ1\det(Q) = \pm 1
  • โˆฅQxโˆฅ=โˆฅxโˆฅ\|Q\mathbf{x}\| = \|\mathbf{x}\| for all x\mathbf{x} (preserves length)
  • โŸจQx,QyโŸฉ=โŸจx,yโŸฉ\langle Q\mathbf{x}, Q\mathbf{y} \rangle = \langle \mathbf{x}, \mathbf{y} \rangle (preserves dot product)
Example 1: 2ร—2 Rotation Matrix
>Q=[cosโกฮธโˆ’sinโกฮธsinโกฮธcosโกฮธ]>> Q = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix} >
Check:
>QTQ=[cosโกฮธsinโกฮธโˆ’sinโกฮธcosโกฮธ][cosโกฮธโˆ’sinโกฮธsinโกฮธcosโกฮธ]=[1001]>> Q^T Q = \begin{bmatrix} \cos\theta & \sin\theta \\ -\sin\theta & \cos\theta \end{bmatrix} \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} >
โœ“ detโก(Q)=cosโก2ฮธ+sinโก2ฮธ=1\det(Q) = \cos^2\theta + \sin^2\theta = 1 Example 2: 2ร—2 Reflection Matrix
Reflection across xx-axis:
>Q=[100โˆ’1]>> Q = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} >
QTQ=IQ^T Q = I โœ“, detโก(Q)=โˆ’1\det(Q) = -1

2.2 Determinant = ยฑ1

If QQ is orthogonal, QTQ=IQ^T Q = I, so:
1=detโก(I)=detโก(QTQ)=detโก(QT)detโก(Q)=(detโก(Q))21 = \det(I) = \det(Q^T Q) = \det(Q^T)\det(Q) = (\det(Q))^2
Therefore detโก(Q)=ยฑ1\det(Q) = \pm 1.
  • detโก(Q)=1\det(Q) = 1: Proper rotation (orientation-preserving)
  • detโก(Q)=โˆ’1\det(Q) = -1: Reflection or rotation + reflection (orientation-reversing)

3. Geometry of Orthogonal Transformations

3.1 Rotations in R2\mathbb{R}^2

R(ฮธ)=[cosโกฮธโˆ’sinโกฮธsinโกฮธcosโกฮธ]R(\theta) = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}
Rotates vectors counterclockwise by ฮธ\theta.

3.2 Rotations in R3\mathbb{R}^3

Rotation around xx-axis by ฮธ\theta:
Rx(ฮธ)=[1000cosโกฮธโˆ’sinโกฮธ0sinโกฮธcosโกฮธ]R_x(\theta) = \begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos\theta & -\sin\theta \\ 0 & \sin\theta & \cos\theta \end{bmatrix}
Rotation around yy-axis by ฮธ\theta:
Ry(ฮธ)=[cosโกฮธ0sinโกฮธ010โˆ’sinโกฮธ0cosโกฮธ]R_y(\theta) = \begin{bmatrix} \cos\theta & 0 & \sin\theta \\ 0 & 1 & 0 \\ -\sin\theta & 0 & \cos\theta \end{bmatrix}
Rotation around zz-axis by ฮธ\theta:
Rz(ฮธ)=[cosโกฮธโˆ’sinโกฮธ0sinโกฮธcosโกฮธ0001]R_z(\theta) = \begin{bmatrix} \cos\theta & -\sin\theta & 0 \\ \sin\theta & \cos\theta & 0 \\ 0 & 0 & 1 \end{bmatrix}

3.3 Reflections

Reflection across a line through origin with unit direction u\mathbf{u}:
H=Iโˆ’2uuTH = I - 2\mathbf{u}\mathbf{u}^T
This is called a Householder reflection.
Example 3: Reflection across line y = x
u=(12,โˆ’12)\mathbf{u} = \left(\frac{1}{\sqrt{2}}, -\frac{1}{\sqrt{2}}\right) (unit normal to line y=xy=x).
>H=Iโˆ’2uuT=[1001]โˆ’2[1/2โˆ’1/2โˆ’1/21/2]=[0110]>> H = I - 2\mathbf{u}\mathbf{u}^T = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} - 2\begin{bmatrix} 1/2 & -1/2 \\ -1/2 & 1/2 \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} >
.
Check: H(1,2)=(2,1)H(1,2) = (2,1) โœ“ (swaps coordinates, reflecting across y=xy=x).

4. Properties

PropertyFormula
InverseQโˆ’1=QTQ^{-1} = Q^T
Preserves norm$\
Preserves dot productโŸจQx,QyโŸฉ=โŸจx,yโŸฉ\langle Q\mathbf{x}, Q\mathbf{y} \rangle = \langle \mathbf{x}, \mathbf{y} \rangle
Preserves anglesAngle between QxQ\mathbf{x} and QyQ\mathbf{y} = angle between x\mathbf{x} and y\mathbf{y}
Determinantdetโก(Q)=ยฑ1\det(Q) = \pm 1
Eigenvalues$
ProductProduct of orthogonal matrices is orthogonal

5. Edge Cases & Gotchas

SituationWhat Happens
** Q=IQ = I **Orthogonal (identity is a rotation by 0ยฐ)
** Q=โˆ’IQ = -I **Orthogonal (rotation by 180ยฐ in R2\mathbb{R}^2 )
Permutation matricesOrthogonal โ€” they just reorder coordinates
Non-square matrices with orthonormal columnsCalled semi-orthogonal; QTQ=IQ^T Q = I but QQTโ‰ IQ Q^T \neq I

6. Common Pitfalls

โŒ Pitfall 1: Thinking "orthogonal" means entries are orthogonal

An orthogonal matrix has orthonormal columns, not necessarily orthogonal entries.

โŒ Pitfall 2: Confusing orthogonal with diagonalisable

Orthogonal matrices are diagonalisable over C\mathbb{C} (eigenvalues have โˆฃฮปโˆฃ=1|\lambda|=1) but may not be diagonalisable over R\mathbb{R} (rotation matrices have complex eigenvalues).

โŒ Pitfall 3: Assuming QT=Qโˆ’1Q^T = Q^{-1} for non-square matrices

For non-square matrices with orthonormal columns, QTQ=IQ^T Q = I but QQTโ‰ IQ Q^T \neq I, so QTโ‰ Qโˆ’1Q^T \neq Q^{-1}.

7. Formula Summary Table

ConceptFormula
DefinitionQTQ=IQ^T Q = I
InverseQโˆ’1=QTQ^{-1} = Q^T
Norm preservation$\
**Rotation in R2\mathbb{R}^2 **[cosโกฮธโˆ’sinโกฮธsinโกฮธcosโกฮธ]\begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}
Householder reflectionH=Iโˆ’2uuTH = I - 2\mathbf{u}\mathbf{u}^T
Determinantdetโก(Q)=ยฑ1\det(Q) = \pm 1

8. ๐Ÿ“ Practice Questions

Q1: Orthogonal check
Is
>Q=13[221โˆ’2121โˆ’22]>> Q = \frac{1}{3}\begin{bmatrix} 2 & 2 & 1 \\ -2 & 1 & 2 \\ 1 & -2 & 2 \end{bmatrix} >
orthogonal?
Solution: Compute QTQQ^T Q (should be II).
>QTQ=19[2โˆ’2121โˆ’2122][221โˆ’2121โˆ’22]>> Q^T Q = \frac{1}{9}\begin{bmatrix} 2 & -2 & 1 \\ 2 & 1 & -2 \\ 1 & 2 & 2 \end{bmatrix}\begin{bmatrix} 2 & 2 & 1 \\ -2 & 1 & 2 \\ 1 & -2 & 2 \end{bmatrix} >
. Entry (1,1): 19(4+4+1)=1\frac{1}{9}(4+4+1) = 1. (1,2): 19(4โˆ’2โˆ’2)=0\frac{1}{9}(4-2-2)=0. (1,3): 19(2+4+2)=89โ‰ 0\frac{1}{9}(2+4+2)=\frac{8}{9}\neq 0.
Not orthogonal. Wait โ€” let me recheck. 2(1)+(โˆ’2)(2)+1(2)=2โˆ’4+2=02(1) + (-2)(2) + 1(2) = 2 - 4 + 2 = 0. So (1,3)=0 โœ“. Let me recompute: 2(1)+(โˆ’2)(2)+1(2)=2โˆ’4+2=02(1)+(-2)(2)+1(2)=2-4+2=0 โœ“. All off-diagonal should be 0. And diagonal entries = 1. Yes, it is orthogonal. detโก(Q)=127(2(2โˆ’(โˆ’4))โˆ’2(โˆ’4โˆ’2)+1(4โˆ’1))=127(12+12+3)=2727=1\det(Q) = \frac{1}{27}(2(2-(-4))-2(-4-2)+1(4-1)) = \frac{1}{27}(12+12+3)=\frac{27}{27}=1. So QQ is orthogonal with detโก=1\det=1. Q2: Inverse of orthogonal matrix
If
>Q=[01โˆ’10]>> Q = \begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix} >
, find Qโˆ’1Q^{-1}.
Solution: For orthogonal matrices,
>Qโˆ’1=QT=[0โˆ’110]>> Q^{-1} = Q^T = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix} >
. Check:
>QQT=[01โˆ’10][0โˆ’110]=[1001]>> Q Q^T = \begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix}\begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} >
โœ“. Q3: Product of orthogonal matrices
If Q1Q_1 and Q2Q_2 are orthogonal, show Q1Q2Q_1 Q_2 is orthogonal.
Proof: (Q1Q2)T(Q1Q2)=Q2TQ1TQ1Q2=Q2TIQ2=Q2TQ2=I(Q_1 Q_2)^T (Q_1 Q_2) = Q_2^T Q_1^T Q_1 Q_2 = Q_2^T I Q_2 = Q_2^T Q_2 = I. โœ“ Q4: Rotation by 45ยฐ
Find the image of (1,0)(1,0) under rotation by 45โˆ˜45^\circ.
Solution: cosโก45โˆ˜=sinโก45โˆ˜=22\cos 45^\circ = \sin 45^\circ = \frac{\sqrt{2}}{2}.
>R(ฯ€4)=[2/2โˆ’2/22/22/2]>> R\left(\frac{\pi}{4}\right) = \begin{bmatrix} \sqrt{2}/2 & -\sqrt{2}/2 \\ \sqrt{2}/2 & \sqrt{2}/2 \end{bmatrix} >
. R(1,0)=(22,22)R(1,0) = \left(\frac{\sqrt{2}}{2}, \frac{\sqrt{2}}{2}\right). Q5: Reflection matrix
Find the matrix that reflects across the line y=โˆ’xy = -x.
Solution: Unit normal to y=โˆ’xy=-x: u=(12,12)\mathbf{u} = \left(\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}}\right).
>H=Iโˆ’2uuT=[1001]โˆ’2[1/21/21/21/2]=[0โˆ’1โˆ’10]>> H = I - 2\mathbf{u}\mathbf{u}^T = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} - 2\begin{bmatrix} 1/2 & 1/2 \\ 1/2 & 1/2 \end{bmatrix} = \begin{bmatrix} 0 & -1 \\ -1 & 0 \end{bmatrix} >
.
Check: H(1,0)=(0,โˆ’1)H(1,0) = (0,-1) which is (1,0)(1,0) reflected across y=โˆ’xy=-x โœ“. Q6: Determinant of orthogonal matrix
If QQ is 5ร—55 \times 5 orthogonal with detโก(Q)=โˆ’1\det(Q) = -1, what does this tell us?
Solution: detโก(Q)=โˆ’1\det(Q) = -1 means QQ reverses orientation. It's a reflection, or a rotation composed with a reflection (improper rotation). It must have an odd number of eigenvalues equal to โˆ’1-1. Q7: Orthogonal diagonalisation
If AA is symmetric, it can be orthogonal diagonalised: A=QTDQA = Q^T D Q where QQ is orthogonal and DD is diagonal. Why is this useful?
Solution: This is the Spectral Theorem. It means we can find an orthonormal basis of eigenvectors. Computing Ak=QTDkQA^k = Q^T D^k Q is easy. PCA, covariance matrices, and quadratic forms all use this. Q8: Norm preservation proof
Prove โˆฅQxโˆฅ=โˆฅxโˆฅ\|Q\mathbf{x}\| = \|\mathbf{x}\| for orthogonal QQ.
Proof: โˆฅQxโˆฅ2=โŸจQx,QxโŸฉ=(Qx)T(Qx)=xTQTQx=xTIx=xTx=โˆฅxโˆฅ2\|Q\mathbf{x}\|^2 = \langle Q\mathbf{x}, Q\mathbf{x} \rangle = (Q\mathbf{x})^T (Q\mathbf{x}) = \mathbf{x}^T Q^T Q \mathbf{x} = \mathbf{x}^T I \mathbf{x} = \mathbf{x}^T \mathbf{x} = \|\mathbf{x}\|^2. Taking square roots gives the result. โœ“ Q9: 3D rotation
Find the matrix for rotation around the zz-axis by 90โˆ˜90^\circ.
Solution: cosโก90โˆ˜=0\cos 90^\circ = 0, sinโก90โˆ˜=1\sin 90^\circ = 1.
>Rz(90โˆ˜)=[0โˆ’10100001]>> R_z(90^\circ) = \begin{bmatrix} 0 & -1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix} >
. Check: Rz(1,0,0)=(0,1,0)R_z(1,0,0) = (0,1,0) โœ“. Q10: Orthogonal matrix with det = -1
Find a 3ร—33 \times 3 orthogonal matrix with determinant โˆ’1-1.
Solution: Reflection across xyxy-plane:
>Q=[10001000โˆ’1]>> Q = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & -1 \end{bmatrix} >
. QTQ=IQ^T Q = I โœ“. detโก(Q)=โˆ’1\det(Q) = -1 โœ“.

๐Ÿ”— Cross-References

Document outline

Keep your place and jump directly to a heading.

Table of contents

No note selected

Open a chapter to see its outline, backlinks, and sources here.