IP331.com | Online Tools
HomeMatrix ToolsGram-Schmidt Orthogonalization Calculator

Gram-Schmidt Orthogonalization Calculator

Compute orthogonal basis using Gram-Schmidt process for 2D and 3D vectors

Enter 2D Vectors
Vector v1
Vector v2

Gram-Schmidt Formula

u1 = v1
u2 = v2 - proj(v2, u1)
u3 = v3 - proj(v3, u1) - proj(v3, u2)
proj(v, u) = (v·u / ||u||²) * u
||u||² = u·u (squared norm)

Gram-Schmidt orthogonalization converts linearly independent vectors into orthogonal vectors. Start with u1 = v1. Each subsequent vector subtracts projections onto previous orthogonal vectors. The result is an orthogonal basis for the same subspace.

Input vectors must be linearly independent. If dependent, zero vectors will appear in the result.

What is Gram-Schmidt?

Gram-Schmidt orthogonalization is a process to convert a set of linearly independent vectors into orthogonal vectors. It works by sequentially projecting each vector onto the span of previous orthogonal vectors and subtracting this projection from the current vector. This preserves linear independence while making vectors orthogonal.

Orthogonal Vectors

Vectors are orthogonal if u·v = 0. Right angles, no projection onto each other.

Inner Product

v·u = v1*u1 + v2*u2 + ... + vn*un. Sum of element-wise products.

Projection

The shadow of v onto u direction. Scaled by (v·u)/(u·u).

Subspace

v1...vn and u1...un span the same subspace. Same linear combinations.

Teaching Example: v1 = [1,0], v2 = [1,1].
1. u1 = v1 = [1,0], ||u1||² = 1
2. v2·u1 = 1*1 + 1*0 = 1
3. proj(v2,u1) = (1/1)*[1,0] = [1,0]
4. u2 = [1,1] - [1,0] = [0,1] (orthogonal!)

Applications

QR Decomposition Least Squares Signal Processing Computer Graphics Numerical Methods

Frequently Asked Questions

What is Gram-Schmidt?
Process to convert linearly independent vectors into orthogonal basis.
Gram-Schmidt formula?
u1 = v1, u2 = v2 - proj(v2,u1), u3 = v3 - proj(v3,u1) - proj(v3,u2)
Projection formula?
proj(v,u) = (v·u / ||u||²) * u
Why orthogonal basis?
Simplifies projections, inner products, and solves Ax=b easily.

More Matrix Tools

Free online calculators and tools covering mathematics, unit conversion, text processing, and daily life. Accurate, fast, mobile-friendly, and completely free to use.

© 2026 IP331.com — Free Online Tools. All rights reserved.

About · Contact · Privacy Policy · Cookie Policy · Terms of Use · Disclaimer · Sitemap