Gram-Schmidt Calculator

Transform any set of vectors into an orthonormal basis using the Gram-Schmidt orthogonalization process

Vector Input

(
,
)
(
,
)

Gram-Schmidt Results

Enter non-zero vectors to see the Gram-Schmidt orthogonalization

The process will create an orthonormal basis from your input vectors

Example: 2D Vectors

Input Vectors

v₁ = (3, 1)

v₂ = (2, 2)

Gram-Schmidt Process

Step 1: u₁ = v₁ = (3, 1)

Step 2: u₂ = v₂ - proj_u₁(v₂)

proj_u₁(v₂) = [(v₂·u₁)/(u₁·u₁)] × u₁ = [8/10] × (3,1) = (2.4, 0.8)

u₂ = (2, 2) - (2.4, 0.8) = (-0.4, 1.2)

Result: Orthogonal basis: 1.2

Gram-Schmidt Process

1

Start with v₁

u₁ = v₁

First vector remains unchanged

2

Orthogonalize

u₂ = v₂ - proj_u₁(v₂)

Remove component parallel to u₁

3

Normalize

eᵢ = uᵢ / ||uᵢ||

Create unit vectors

Key Formulas

Projection Formula

proj_u(v) = (v·u)/(u·u) × u

Vector Magnitude

||v|| = √(v·v)

Dot Product

v·w = v₁w₁ + v₂w₂ + ... + vₙwₙ

Unit Vector

û = v / ||v||

Understanding the Gram-Schmidt Process

What is Gram-Schmidt Orthogonalization?

The Gram-Schmidt process is a mathematical algorithm that transforms any set of linearly independent vectors into an orthonormal basis. It takes vectors that may point in various directions and creates a new set where all vectors are perpendicular to each other and have unit length.

Key Concepts

  • Orthogonal: Vectors with dot product = 0
  • Orthonormal: Orthogonal vectors with unit length
  • Basis: Minimal set spanning the vector space
  • Linear Independence: No vector is a combination of others

Applications

  • QR decomposition in linear algebra
  • Least squares approximation
  • Signal processing and data analysis
  • Computer graphics and 3D modeling
  • Machine learning feature extraction

Note: The process eliminates linearly dependent vectors, resulting in fewer basis vectors than input vectors if dependencies exist.

Mathematical Foundation

Given vectors v₁, v₂, ..., vₙ, the Gram-Schmidt process produces orthonormal vectors e₁, e₂, ..., eₖ where k ≤ n:

u₁ = v₁

u₂ = v₂ - proj_u₁(v₂)

u₃ = v₃ - proj_u₁(v₃) - proj_u₂(v₃)

...

eᵢ = uᵢ / ||uᵢ|| for each non-zero uᵢ

The projection formula: proj_u(v) = (v·u)/(u·u) × u removes the component of v that is parallel to u, leaving only the perpendicular component.