Computing Library › Linear Algebra
Linear Algebra

Orthogonality

Vectors are orthogonal when their dot product is zero, a condition that simplifies geometry, projection, and computation.

The core idea

Two vectors are orthogonal when their dot product is zero, generalizing the notion of being at right angles. Orthogonality is powerful because it lets you treat directions independently: a component along one orthogonal direction does not interfere with a component along another. This independence turns coupled problems into separate one-dimensional ones.

The Pythagorean theorem

Kronos motion — when

When x and y are orthogonal, |x + y|^2 = |x|^2 + |y|^2. This is the Pythagorean theorem in vector form, and it generalizes to any number of mutually orthogonal vectors. It is the reason energy and variance decompose additively across orthogonal components in physics and statistics.

Orthogonal sets are independent

Any set of nonzero mutually orthogonal vectors is automatically linearly independent, because no one of them can have a component along the others. This gives an easy route to bases: find enough mutually orthogonal vectors and you have an orthogonal basis, with coordinates computed by simple dot products rather than by solving a system.

Orthogonal complements

The orthogonal complement of a subspace W is the set of all vectors perpendicular to every vector in W. The whole space splits as the direct sum of W and its complement, so every vector decomposes uniquely into a part in W and a part orthogonal to it. That decomposition is exactly orthogonal projection.

python
import numpy as np
x = np.array([1.0, 1.0, 0.0])
y = np.array([1.0, -1.0, 0.0])
print(np.isclose(x @ y, 0.0))   # True, orthogonal
print(np.isclose(np.linalg.norm(x+y)**2,
                 np.linalg.norm(x)**2 + np.linalg.norm(y)**2))

Orthogonal expansions, from Fourier series to spectral methods, exploit this independence to represent physical fields as sums of non-interfering modes, dramatically simplifying the governing equations.