Gram-Schmidt Orthogonalization — Stepwise Visualization in 2D and 3D

A visual note on gradual orthogonalization, normalization and the geometric structure of the Gram-Schmidt algorithm

Gram-Schmidt orthogonalization transforms a set of independent columns into an orthogonal, then orthonormal, basis. The process can be viewed not only as a symbolic algorithm, but also as a sequence of geometric changes in space.

The visualizations below show the algorithm step by step in two and three dimensions, together with a structural summary of what gradual orthogonalization reveals.

Overview

One useful way to view Gram-Schmidt is as a sequence of right-side updates that change one active column at a time. In this interpretation, scale and shear are removed step by step from the original matrix, producing the orthonormal matrix Q, while the removed transformations accumulate into the upper-triangular factor R.

Summary diagram explaining what is learned from gradual orthogonalization, including right-multiplication by shear and scaling matrices, accumulation into R and the connection to QR and LQ factorizations.
Summary of the structural ideas behind gradual orthogonalization, including one-column-at-a-time right-multiplication, accumulation into R and the connection to related factorization viewpoints.

Stepwise orthogonalization in 2D

In two dimensions, the first column is normalized, then the second is orthogonalized against it and normalized. The static diagram shows the sequence as a chain of intermediate matrices, while the animation shows the same process unfolding continuously.

Static 2D diagram showing columns during orthogonalization, with intermediate matrices and the resulting orthonormal basis.
Static 2D view of the intermediate matrices during Gram-Schmidt orthogonalization.
Animated 2D Gram-Schmidt process showing the original vectors and the step-by-step transformation into an orthonormal basis.
Animated 2D view of the same process. The geometric changes correspond to the symbolic updates that normalize the first column and then remove the component of the second column in that direction.

Stepwise orthogonalization in 3D

In three dimensions, the same logic continues one column at a time. After the first normalization, the second column is made orthogonal to the first, then normalized, and finally the third is corrected against the first two and normalized.

Static 3D diagram showing columns during orthogonalization, with intermediate matrices and the resulting orthonormal basis.
Static 3D view of the intermediate matrices during Gram-Schmidt orthogonalization.
Animated 3D Gram-Schmidt process showing the original vectors and the step-by-step transformation into an orthonormal basis.
Animated 3D view of the orthogonalization process. Each new direction is corrected against the previously established orthogonal directions, making the construction of the orthonormal basis visible step by step.

Concept

Gram-Schmidt converts independent columns into orthonormal columns. In matrix form, this produces the factor Q of QR decomposition, while the coefficients used during the process are recorded in the upper-triangular factor R.

These images emphasize the process viewpoint: the columns are not replaced all at once, but are corrected and normalized in a definite order, with each step acting on one active column.

Key equations

q₁ = a₁ / |a₁|
a₂⊥ = a₂ − (q₁ᵀa₂) q₁
q₂ = a₂⊥ / |a₂⊥|
a₃⊥ = a₃ − (q₁ᵀa₃) q₁ − (q₂ᵀa₃) q₂
q₃ = a₃⊥ / |a₃⊥|
A = Q R

The geometric process shown above is another way to understand these symbolic updates.

Query phrases

  • Gram-Schmidt stepwise visualization
  • Gram-Schmidt orthogonalization animation
  • how Gram-Schmidt works geometrically
  • Gram-Schmidt in 2D and 3D
  • step by step QR construction

References

Related concept page: GraphMath — QR Decomposition, Geometric Interpretation in 2D and 3D

Related chapter: GraphMath — QRF, Gram-Schmidt, part 2