Quiz 2

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 Q1=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, Q1=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)=cos2θ+sin2θ=1\det(Q) = \cos^2\theta + \sin^2\theta = 1 Example 2: 2×2 Reflection Matrix
Reflection across xx-axis:
>Q=[1001]>> 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θ010sinθ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=I2uuTH = 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=I2uuT=[1001]2[1/21/21/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
InverseQ1=QTQ^{-1} = Q^T
Preserves norm$\
Preserves dot productQx,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 QQTIQ 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=Q1Q^T = Q^{-1} for non-square matrices

For non-square matrices with orthonormal columns, QTQ=IQ^T Q = I but QQTIQ Q^T \neq I, so QTQ1Q^T \neq Q^{-1}.

7. Formula Summary Table

ConceptFormula
DefinitionQTQ=IQ^T Q = I
InverseQ1=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=I2uuTH = I - 2\mathbf{u}\mathbf{u}^T
Determinantdet(Q)=±1\det(Q) = \pm 1

8. 📝 Practice Questions

Q1: Orthogonal check
Is
>Q=13[221212122]>> 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[221212122][221212122]>> 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(422)=0\frac{1}{9}(4-2-2)=0. (1,3): 19(2+4+2)=890\frac{1}{9}(2+4+2)=\frac{8}{9}\neq 0.
Not orthogonal. Wait — let me recheck. 2(1)+(2)(2)+1(2)=24+2=02(1) + (-2)(2) + 1(2) = 2 - 4 + 2 = 0. So (1,3)=0 ✓. Let me recompute: 2(1)+(2)(2)+1(2)=24+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(42)+1(41))=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=[0110]>> Q = \begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix} >
, find Q1Q^{-1}.
Solution: For orthogonal matrices,
>Q1=QT=[0110]>> Q^{-1} = Q^T = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix} >
. Check:
>QQT=[0110][0110]=[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 4545^\circ.
Solution: cos45=sin45=22\cos 45^\circ = \sin 45^\circ = \frac{\sqrt{2}}{2}.
>R(π4)=[2/22/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=I2uuT=[1001]2[1/21/21/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,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: Qx2=Qx,Qx=(Qx)T(Qx)=xTQTQx=xTIx=xTx=x2\|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 9090^\circ.
Solution: cos90=0\cos 90^\circ = 0, sin90=1\sin 90^\circ = 1.
>Rz(90)=[010100001]>> 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=[100010001]>> 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
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.