Gram-Schmidt Process

Step through the algorithm to build the orthonormal basis. Click and drag the 3D graph to explore the projections from different angles.

Gram-Schmidt Process
A = [ a₁   a₂   a₃ ]
  • 1. Normalize a₁ as q₁:
    q₁ =
    a₁ ‖a₁‖
  • 2. Project a₂ onto q₁: a₂₁ = (a₂Tq₁)q₁
    • Get part perpendicular to q₁:
      a2⊥ = a₂ - a₂₁
    • Normalize a2⊥ as q₂:
      q₂ =
      a2⊥ ‖a2⊥
  • 3. Project a₃ onto q₁ and q₂:
    a31₁ = (a₃Tq₁)q₁ & a31₂ = (a₃Tq₂)q₂
    • Get part perpendicular to both:
      a3⊥ = a₃ - (a31₁ + a31₂)
    • Normalize a3⊥ as q₃:
      q₃ =
      a3⊥ ‖a3⊥

Enjoying this visualization?

Get the full textbook:
Linear Algebra for Computer Science

Drag to rotate • Scroll to zoom