Gram-Schmidt Orthogonalization

Orthonormal basis builder

CalculatorsFreeNo Signup
4.6(783 reviews)
All Tools

Loading tool...

About Gram-Schmidt Orthogonalization

A Gram-Schmidt orthogonalization calculator. Transforms a set of linearly independent vectors into an orthonormal basis. Shows projection and subtraction steps. Verifies orthonormality. Select from preset vector sets. All calculations are client-side. Foundation for QR decomposition.

Gram-Schmidt Orthogonalization Features

  • Step-by-step
  • Projections
  • Normalization
  • Verify ortho
  • Presets
Gram-Schmidt: given {v₁,...,vₙ}, produce orthonormal {e₁,...,eₙ}. u₁=v₁, e₁=u₁/||u₁||. uₖ = vₖ − Σⱼ<ₖ proj(eⱼ,vₖ). eₖ = uₖ/||uₖ||. Result: eᵢ·eⱼ=δᵢⱼ. Span preserved at each step.

How to Use

Enter vectors:

  • Input: Linearly independent vectors
  • Output: Orthonormal basis
  • Steps: All projections shown

Projection Formula

proj(e,v) = (v·e)e. This is the component of v in direction e. Gram-Schmidt subtracts all these components: what remains is orthogonal to all previous vectors.

Numerical Stability

Classical GS: project v against original vectors (unstable). Modified GS: project against already-orthogonalized vectors (stable). Same in exact arithmetic, different in floating point.

Step-by-Step Instructions

  1. 1Enter vectors.
  2. 2See projections.
  3. 3Watch orthogonalization.
  4. 4Get orthonormal basis.
  5. 5Verify orthonormality.

Gram-Schmidt Orthogonalization — Frequently Asked Questions

Why do we need orthonormal bases?+

Coordinates are trivial: cᵢ = v·eᵢ (dot product, not linear system solve). Projections are easy. Transformations preserve length. QR decomposition = Gram-Schmidt on matrix columns. Fourier series = continuous Gram-Schmidt.

What if vectors are linearly dependent?+

You get uₖ = 0 at some step (everything projects away). The process reveals linear dependence. In practice, ||uₖ|| ≈ 0 indicates near-dependence. Skip that vector or detect rank deficiency.

Modified vs Classical Gram-Schmidt?+

Same math, different order. Classical: project vₖ against all original uⱼ simultaneously. Modified: project vₖ against e₁, update, then against e₂, update, etc. Modified accumulates less rounding error.

Share this tool: