Linear Algebra Learning Studio · Module 06

Orthogonality and Projections

Learn inner products, angles, orthogonal projections, Gram-Schmidt orthonormalization, QR factorization, and residual geometry.

Offline browser lab Interactive mathematics Student practice environment
Module 06 · Inner products

Use perpendicular structure to decompose vectors and compute closest approximations

Orthogonality generalizes perpendicularity. Inner products define angles and lengths, orthonormal bases simplify coordinates, projections find closest points in subspaces, and Gram–Schmidt converts an independent set into an orthonormal one without changing its span.

Compute dot products and anglesProject onto a vectorDecompose residualsUse Gram–SchmidtConnect projection and least squares
01

Inner products, norms, and angles

Measure alignment between vectors

u·v = Σᵢuᵢvᵢ    |    ‖u‖=√(u·u)    |    cosθ=(u·v)/(‖u‖‖v‖)
u·v>0

Acute alignment

The vectors point generally in the same direction.

u·v=0

Orthogonal

Nonzero vectors meet at a right angle.

u·v<0

Obtuse alignment

The vectors point generally in opposite directions.

The Cauchy–Schwarz inequality |u·v|≤‖u‖‖v‖ guarantees that the cosine formula remains between −1 and 1.

02

Projection onto a direction

Split a vector into parallel and perpendicular components

projᵤ(v) = (v·u)/(u·u) u    for u≠0
Orthogonal decomposition

Every vector v can be written as v=projᵤ(v)+r, where r=v−projᵤ(v) and u·r=0. The projection is the point on span{u} closest to v.

Do not omit the denominator

The shortcut projᵤ(v)=(v·u)u is valid only when u is a unit vector. For an arbitrary u, divide by u·u.

03

Projection onto a subspace

Use orthonormal columns whenever possible

If Q has orthonormal columns spanning W, the projection matrix is P=QQᵀ and proj_W(b)=QQᵀb. If A has independent but nonorthonormal columns, P=A(AᵀA)⁻¹Aᵀ.

P²=P,   Pᵀ=P,   and b−Pb ⟂ C(A)

A projection matrix is idempotent: applying the projection twice has the same effect as applying it once.

04

Interactive projection and Gram–Schmidt laboratory

Calculate components and construct an orthonormal basis

Dot product, angle, and projection

Three-dimensional calculations are shown numerically; the canvas displays the first two coordinates.

R³ calculation
The gold dashed segment is the orthogonal residual from the projection point to v in the displayed x-y plane.

Gram–Schmidt orthonormalization

Enter three row vectors in R³. Dependent vectors are identified and omitted.

Basis construction

Run Gram–Schmidt to construct Q.

05

QR factorization and least squares

Turn orthogonality into a computational method

Applying Gram–Schmidt to the independent columns of A produces A=QR, where Q has orthonormal columns and R is upper triangular. For least squares, Ax≈b becomes Rx=Qᵀb. Modern software usually uses numerically stable variants such as modified Gram–Schmidt or Householder reflections.

Why Q helps

QᵀQ=I, so coordinates in the Q basis are simple dot products.

Why R helps

Upper-triangular systems are solved efficiently by back substitution.

06

Review questions

Check angles, projections, and orthonormal structure

Knowledge check

When are two nonzero real vectors orthogonal?

Knowledge check

What is projᵤ(v) for nonunit u?

Knowledge check

If Q has orthonormal columns, which identity holds?

Knowledge check

What does Gram–Schmidt preserve?

Knowledge check

For a projection matrix P onto a subspace, which property holds?