Skip to main content
Home / Orthogonality / Orthonormal Basis

Orthogonality

Orthogonal projections, bases, and distances

💡 Need Help?

  • • Enter fractions like 1/2
  • • Use decimals like 0.5
  • • Click "Load Example" to try a preset
  • • Click any step to copy LaTeX
Calculating...

Orthonormal Basis Calculator

An orthonormal basis consists of unit vectors that are mutually perpendicular. This solver uses the Gram-Schmidt process to convert any set of linearly independent vectors into an orthonormal basis that spans the same subspace.

Vectors:
Dimension: D
Enter fractions like 1/2 or decimals like 0.5. The solver will generate an orthonormal basis using the Gram-Schmidt process.

What is an Orthonormal Basis?

An orthonormal basis is a set of vectors that is both:

1. Orthogonal

Every pair of distinct vectors is perpendicular:

$$ \mathbf{v}_i \cdot \mathbf{v}_j = 0 \quad \text{for } i \neq j $$

2. Normalized (Unit Length)

Each vector has length exactly 1:

$$ \|\mathbf{v}_i\| = 1 \quad \text{for all } i $$

💡 Key Insight: An orthonormal basis is like a "perfect coordinate system" where axes are perpendicular and unit length—just like the standard x, y, z axes!

Example: Standard Basis in ℝ³

$$ \mathbf{e}_1 = \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix},\quad \mathbf{e}_2 = \begin{bmatrix} 0 \\ 1 \\ 0 \end{bmatrix},\quad \mathbf{e}_3 = \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} $$

Check: e₁·e₂ = 0, ‖e₁‖ = 1, etc. ✓ This is an orthonormal basis!


Why Orthonormal Basis Matters

✅ Makes Computation Simple

In an orthonormal basis, coordinates are found using dot products:

$$ \text{coordinate}_i = \mathbf{v} \cdot \mathbf{u}_i $$

No need to solve linear systems!

✅ Preserves Length and Angles

When using an orthonormal basis, dot products (and therefore lengths and angles) are computed the same way as in standard coordinates.

✅ Orthogonal Matrices

If you arrange orthonormal vectors as columns of a matrix Q, then:

$$ Q^T Q = I \quad \text{(Q is orthogonal)} $$

This means Q⁻¹ = Qᵀ — incredibly useful!

✅ Simplifies Projections

Projecting onto a subspace with orthonormal basis is just:

$$ \text{proj}_W(\mathbf{v}) = \sum_i (\mathbf{v} \cdot \mathbf{u}_i) \mathbf{u}_i $$

🎯 Bottom Line: Orthonormal bases are the "gold standard" for linear algebra computations—they make everything easier, more stable, and more intuitive!


How to Find an Orthonormal Basis

The Two-Step Process

Step 1: Orthogonalize

Use the Gram-Schmidt process to convert the original vectors into an orthogonal set.

$$ \begin{aligned} \mathbf{u}_1 &= \mathbf{v}_1 \\\\ \mathbf{u}_2 &= \mathbf{v}_2 - \frac{\mathbf{v}_2 \cdot \mathbf{u}_1}{\mathbf{u}_1 \cdot \mathbf{u}_1} \mathbf{u}_1 \\\\ \mathbf{u}_3 &= \mathbf{v}_3 - \frac{\mathbf{v}_3 \cdot \mathbf{u}_1}{\mathbf{u}_1 \cdot \mathbf{u}_1} \mathbf{u}_1 - \frac{\mathbf{v}_3 \cdot \mathbf{u}_2}{\mathbf{u}_2 \cdot \mathbf{u}_2} \mathbf{u}_2 \end{aligned} $$

Step 2: Normalize

Divide each orthogonal vector by its length to make it unit length.

$$ \mathbf{e}_i = \frac{\mathbf{u}_i}{\|\mathbf{u}_i\|} $$

The resulting vectors {e₁, e₂, ..., eₖ} form an orthonormal basis for the same subspace!

📐 Important: The number of vectors in the orthonormal basis equals the dimension of the subspace spanned by the original vectors. If the original vectors are linearly dependent, the basis will have fewer vectors.


The Gram-Schmidt Process (Detailed)

The Gram-Schmidt process is the standard algorithm for finding an orthonormal basis. Here's how it works step by step:

Given vectors v₁, v₂, v₃:

Step 1: Start with the first vector

$$ \mathbf{u}_1 = \mathbf{v}_1 $$

Step 2: Subtract the projection of v₂ onto u₁

$$ \mathbf{u}_2 = \mathbf{v}_2 - \frac{\mathbf{v}_2 \cdot \mathbf{u}_1}{\mathbf{u}_1 \cdot \mathbf{u}_1} \mathbf{u}_1 $$

Step 3: Subtract projections of v₃ onto u₁ and u₂

$$ \mathbf{u}_3 = \mathbf{v}_3 - \frac{\mathbf{v}_3 \cdot \mathbf{u}_1}{\mathbf{u}_1 \cdot \mathbf{u}_1} \mathbf{u}_1 - \frac{\mathbf{v}_3 \cdot \mathbf{u}_2}{\mathbf{u}_2 \cdot \mathbf{u}_2} \mathbf{u}_2 $$

Step 4: Normalize each uᵢ to get eᵢ

$$ \mathbf{e}_1 = \frac{\mathbf{u}_1}{\|\mathbf{u}_1\|},\quad \mathbf{e}_2 = \frac{\mathbf{u}_2}{\|\mathbf{u}_2\|},\quad \mathbf{e}_3 = \frac{\mathbf{u}_3}{\|\mathbf{u}_3\|} $$

💡 Modified Gram-Schmidt: For better numerical stability, you can subtract projections immediately after computing each uᵢ. Our calculator uses this approach!


Verifying Orthonormality

Once you have a candidate basis, check these two conditions:

✓ Orthogonality Check

For all i ≠ j:

$$ \mathbf{e}_i \cdot \mathbf{e}_j = 0 $$

This ensures all axes are perpendicular.

✓ Normalization Check

For all i:

$$ \|\mathbf{e}_i\| = \sqrt{\mathbf{e}_i \cdot \mathbf{e}_i} = 1 $$

This ensures each vector has unit length.

Matrix Verification

If you form a matrix Q with orthonormal columns:

$$ Q^T Q = I $$

This is the defining property of orthogonal matrices!

🔍 Our calculator automatically verifies orthonormality and shows you:

  • All pairwise dot products (should be zero)
  • All vector norms (should be 1)
  • Whether QᵀQ = I (for square matrices)

Step-by-Step Examples

Example 1: Orthonormal Basis in ℝ²

Vectors: v₁ = (1, 0), v₂ = (1, 1)

Step 1: Orthogonalize

$$ \mathbf{u}_1 = \mathbf{v}_1 = (1, 0) $$
$$ \mathbf{u}_2 = \mathbf{v}_2 - \frac{\mathbf{v}_2 \cdot \mathbf{u}_1}{\mathbf{u}_1 \cdot \mathbf{u}_1} \mathbf{u}_1 = (1,1) - \frac{1}{1}(1,0) = (0, 1) $$

Step 2: Normalize

$$ \|\mathbf{u}_1\| = 1,\quad \|\mathbf{u}_2\| = 1 $$

Result: e₁ = (1, 0), e₂ = (0, 1) → The standard orthonormal basis!

Example 2: Orthonormal Basis in ℝ³

Vectors: v₁ = (1, 1, 0), v₂ = (1, 0, 1), v₃ = (0, 1, 1)

Step 1: Orthogonalize

$$ \mathbf{u}_1 = (1, 1, 0) $$
$$ \mathbf{u}_2 = (1,0,1) - \frac{1}{1+1+0}(1,1,0) = (1,0,1) - \frac{1}{2}(1,1,0) = \left(\frac12, -\frac12, 1\right) $$
$$ \mathbf{u}_3 = (0,1,1) - \frac{1}{2}(1,1,0) - \frac{\frac12}{\frac12^2+\frac12^2+1^2}\left(\frac12,-\frac12,1\right) $$
$$ \mathbf{u}_3 = \left(-\frac23, \frac23, \frac23\right) $$

Step 2: Normalize

$$ \mathbf{e}_1 = \frac{1}{\sqrt{2}}(1,1,0),\quad \mathbf{e}_2 = \sqrt{\frac{2}{3}}\left(\frac12,-\frac12,1\right),\quad \mathbf{e}_3 = \frac{1}{\sqrt{\frac43}}\left(-\frac23,\frac23,\frac23\right) = \left(-\frac{1}{\sqrt{3}},\frac{1}{\sqrt{3}},\frac{1}{\sqrt{3}}\right) $$

Result: Three orthonormal vectors that span ℝ³. Check: e₁·e₂ = 0, e₁·e₃ = 0, e₂·e₃ = 0, and all have length 1.

Example 3: Dependent Vectors (Dimension Reduction)

Vectors: v₁ = (1, 2), v₂ = (2, 4) (v₂ = 2·v₁)

Process:

$$ \mathbf{u}_1 = (1, 2),\quad \mathbf{u}_2 = (2,4) - \frac{2+8}{1+4}(1,2) = (2,4) - \frac{10}{5}(1,2) = (0,0) $$

Result: Only one orthonormal vector: e₁ = (1/√5, 2/√5). The subspace is 1-dimensional (a line).

This shows that orthonormal basis reflects the true dimension of your vector set!


Special Cases

Case What Happens Basis Size
Already orthonormal Vectors remain unchanged (just normalized if needed) Same as input
Linearly dependent Zero vectors appear and are discarded Rank of the original set
Zero vector included Zero vector produces no contribution, automatically removed Reduced by 1
Orthogonal but not normalized Only normalization needed (no projection steps required) Same as input

⚠️ Important: Starting with orthogonal vectors makes the process much faster! The calculator detects this and skips unnecessary projection steps.


Real-World Applications

📐 QR Decomposition

Any matrix A can be factored as A = QR where Q has orthonormal columns and R is upper triangular. Used in:

  • Least squares problems
  • Eigenvalue algorithms
  • Solving linear systems

👉 Try our QR Decomposition Calculator

🎯 Principal Component Analysis (PCA)

PCA finds orthonormal basis vectors (principal components) that maximize variance. Used in:

  • Dimensionality reduction
  • Data visualization
  • Feature extraction

🔬 Quantum Mechanics

Orthonormal basis vectors represent quantum states. Properties:

  • ⟨ψᵢ|ψⱼ⟩ = δᵢⱼ (Kronecker delta)
  • Any state is combination of basis states
  • Probabilities from squared coefficients

📡 Signal Processing

Orthonormal bases (wavelets, Fourier) allow:

  • Signal compression (JPEG, MP3)
  • Noise removal
  • Feature detection

🤖 Machine Learning

  • Kernel methods use orthonormal features
  • Support Vector Machines (SVMs)
  • Gaussian processes

📊 Statistics

  • Principal components are orthonormal
  • Canonical correlation analysis
  • Factor analysis

Frequently Asked Questions

Q: What's the difference between orthogonal and orthonormal?

A: Orthogonal vectors are perpendicular (dot product = 0). Orthonormal vectors are orthogonal AND have unit length (norm = 1). So orthonormal = orthogonal + normalized.

Q: Does every subspace have an orthonormal basis?

A: Yes! Every subspace of ℝⁿ has an orthonormal basis. Apply Gram-Schmidt to any basis of the subspace.

Q: Is the orthonormal basis unique?

A: No! Any rotation (orthogonal transformation) of an orthonormal basis gives another orthonormal basis. For example, in ℝ², any rotated version of {(1,0), (0,1)} is also orthonormal.

Q: Why do we need to normalize? Can't we just use orthogonal vectors?

A: Orthogonal vectors are great, but normalized vectors make computations simpler. With orthonormal vectors, coefficients are just dot products (no division by norms needed). This is why orthonormal is the gold standard!

Q: What happens if my vectors are already orthogonal?

A: Then the Gram-Schmidt process only needs to normalize them. Our calculator detects this and skips the projection steps!

Q: Can orthonormal vectors be linearly dependent?

A: No! Orthonormal vectors are always linearly independent. If they were dependent, one would be a combination of others, preventing orthogonality.

Q: What's the relationship to orthogonal matrices?

A: If you put orthonormal vectors as columns of a square matrix Q, then Q is orthogonal: Q⁻¹ = Qᵀ. These matrices represent rotations and reflections.


Practice Problems

Beginner

  1. Find an orthonormal basis for the subspace spanned by v₁ = (1, 2).

  2. Check if these vectors form an orthonormal basis in ℝ²: e₁ = (1/√2, 1/√2), e₂ = (-1/√2, 1/√2).

  3. Normalize the orthogonal vectors u₁ = (2, 0), u₂ = (0, 3) to get an orthonormal basis.

Intermediate

  1. Apply Gram-Schmidt to v₁ = (1, 1, 0), v₂ = (1, 0, 1) to find an orthonormal basis for their span.

  2. Find an orthonormal basis for ℝ³ starting from v₁ = (1, 1, 1), v₂ = (1, -1, 0), v₃ = (1, 1, -2).

  3. What happens when you apply Gram-Schmidt to linearly dependent vectors? Why?

Click to reveal solutions

1. e₁ = (1/√5, 2/√5) (only one vector needed)

2. Yes! e₁·e₂ = 0, ‖e₁‖ = 1, ‖e₂‖ = 1 ✓

3. e₁ = (1, 0), e₂ = (0, 1)

4. e₁ = (1/√2, 1/√2, 0), e₂ = (1/√6, -1/√6, 2/√6)

5. e₁ = (1/√3, 1/√3, 1/√3), e₂ = (1/√2, -1/√2, 0), e₃ = (1/√6, 1/√6, -2/√6)

6. You get a zero vector during orthogonalization, which is discarded. The basis size equals the rank (dimension of span).



Summary

🎯 Key Takeaways

  • Orthonormal basis: Orthogonal vectors + unit length √(v·v) = 1
  • Gram-Schmidt: Algorithm to find orthonormal basis from any basis
  • Properties: QᵀQ = I, Q⁻¹ = Qᵀ (for square matrices)
  • Coordinates: In orthonormal basis, coordinates are dot products
  • Applications: QR decomposition, PCA, quantum mechanics, signal processing
  • Verification: Check vᵢ·vⱼ = 0 (i≠j) and ‖vᵢ‖ = 1

💡 Quick Test: Form a matrix Q with vectors as columns. Compute QᵀQ. If you get the identity matrix → orthonormal basis!

Try It Yourself!

Use the calculator above to find orthonormal bases:

  1. Enter your vectors as rows or columns
  2. Choose whether to normalize (usually yes for orthonormal)
  3. Click "Calculate" to see:
    • Orthogonal basis (Gram-Schmidt)
    • Orthonormal basis (normalized)
    • Complete step-by-step process for each vector
    • Verification of orthonormality

📐 Test these examples:

  • ℝ² example: (1, 0), (1, 1) → Standard orthonormal basis
  • ℝ³ example: (1,1,0), (1,0,1), (0,1,1) → Three orthonormal vectors
  • Dependent vectors: (1,2), (2,4) → One orthonormal vector (dimension reduction)
  • Already orthogonal: (1,0), (0,2) → Only needs normalization

🔬 Pro Tip: Orthonormal bases are essential for PCA, QR decomposition, and quantum computing. Mastering them opens doors to advanced topics!