Gram-Schmidt Calculator — Orthonormal Basis
Enter two linearly independent 2-D vectors and the Gram-Schmidt process outputs an orthonormal basis — a pair of unit vectors that are mutually perpendicular.
A result of 0 confirms the output vectors are orthogonal
- 1
Dot product v₂ · u₁
2 × 3 + 4 × 1 = 10 - 2
Norm² |u₁|²
3² + 1² = 10 - 3
Projection scalar
10 ÷ 10 = 1Subtracting this scaled u₁ from v₂ gives the perpendicular component u₂.
How does this calculator work?
Gram-Schmidt converts two independent 2-D vectors v₁, v₂ into orthonormal vectors e₁, e₂. First take e₁ = v₁/|v₁|. Then subtract the component of v₂ along v₁ to get u₂, and normalize: e₂ = u₂/|u₂|. The result is two perpendicular unit vectors.
Formula
How this is calculated
The Gram-Schmidt process converts any set of linearly independent vectors into an orthonormal basis — vectors that are perpendicular to each other and each have unit length. In 2-D, you supply two vectors v₁ and v₂.
The first basis vector is easy: take u₁ = v₁ and normalize it to e₁ = u₁/|u₁|. For the second, the algorithm removes the component of v₂ that lies along u₁ (its projection). The projection of v₂ onto u₁ equals (v₂ · u₁ / |u₁|²) × u₁. Subtracting this from v₂ gives u₂, which is guaranteed to be perpendicular to u₁. Normalizing u₂ gives e₂.
The method fails if v₁ is the zero vector or if v₁ and v₂ are parallel (linearly dependent), because there is no unique perpendicular direction to extract — the calculator flags both cases. The dot product e₁ · e₂ should be 0 (or within floating-point rounding of 0) after a successful computation, confirming orthogonality. This 2-D implementation extends naturally to N dimensions by repeating the projection-and-subtraction step for each new vector.
Frequently asked questions
It is an algorithm that turns any set of linearly independent vectors into an orthonormal set — vectors that are mutually perpendicular and each have a length (norm) of exactly 1. It works by iteratively projecting each vector onto the already-computed basis and subtracting that projection.
If v₁ and v₂ are parallel (one is a scalar multiple of the other), subtracting the projection of v₂ onto v₁ leaves the zero vector — you cannot form a unit vector from zero, and no second independent direction exists.
e₁ and e₂ form a new coordinate system. Any 2-D vector can be expressed as a linear combination of e₁ and e₂. Orthonormal bases simplify many calculations in linear algebra, including QR decomposition and solving least-squares problems.
Also known as
TG we-Calculate Editorial Team. (2026). Gram-Schmidt Calculator — Orthonormal Basis [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/gram-schmidt-calculator
TG we-Calculate Editorial Team. "Gram-Schmidt Calculator — Orthonormal Basis." TG we-Calculate. 2026. https://we-calculate.com/calculator/gram-schmidt-calculator.
TG we-Calculate Editorial Team, "Gram-Schmidt Calculator — Orthonormal Basis," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/gram-schmidt-calculator
@misc{wecalculate_gram_schmidt_calculator, title = {Gram-Schmidt Calculator — Orthonormal Basis}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/gram-schmidt-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
