Basis, Span and Orthogonality

Two vectors either reach every point in the plane or they reach a single line. Drag them and watch the moment it collapses.

Overview

Span

Given some vectors, the span is every point you can reach by scaling them and adding the results. Nothing more exotic than that: pick a multiple of each, add them up, and see where you land.

Two vectors in the plane usually span the whole plane. Any point you name can be written as some amount of the first plus some amount of the second, and the visualisation shows the shaded parallelogram they generate.

Usually — but not always. Drag one vector until it lines up with the other and the parallelogram flattens to nothing. Now every combination lands on a single line, and most of the plane has become unreachable. The vectors are linearly dependent: one is a multiple of the other, so the second adds no direction the first did not already have.

Basis, Span and Orthogonality

This module needs JavaScript: the numbers are computed in the page rather than recorded.

Worth knowing

The span of a set of vectors is everything you can reach by scaling and adding them.
Two vectors in the plane span the whole plane unless they lie on the same line, in which case they span only that line.
The shaded parallelogram is the determinant. It hits zero exactly when the span collapses.
Orthogonal means the dot product is zero. It is not required for a basis, but it makes every calculation easier.

Basis, Span and Orthogonality

What a set of vectors can reach, when it stops reaching everything, and why perpendicular is worth so much.

The determinant is the test

You do not have to eyeball it. The readout gives the determinant, which is the signed area of that parallelogram, and it reaches zero exactly when the span collapses.

That is the same number the [determinant module](determinant.html) covers as an area scale factor, seen from another side. A matrix whose determinant is zero squashes the plane onto a line, which is precisely why it has no inverse: several inputs land on the same output, so nothing can undo it.

Basis

A basis is a set of vectors that spans the space and is linearly independent — enough to reach everything, with nothing redundant.

Both halves matter. Too few vectors and you cannot reach everything. Too many and the representation stops being unique, because there is more than one way to write the same point. A basis is the exact amount.

Once you have one, every point in the space has exactly one set of coordinates in it. That is the whole reason coordinates work at all, and it is why "[change of basis](matrix_as_transformation.html)" is a meaningful operation rather than a rearrangement.

The plane needs exactly two vectors in any basis; three-dimensional space needs three. That count is the dimension, and it does not depend on which basis you choose.

Orthogonality

Two vectors are orthogonal when their [dot product](vectors_and_dot_product.html) is zero — the algebraic way of saying they meet at a right angle. Drag until the readout says so.

Orthogonality is not required for a basis. The default pair above is a perfectly good basis and is nowhere near perpendicular. But an orthogonal basis is worth reaching for, because finding the coordinates of a point becomes a matter of taking one dot product per axis instead of solving a system of equations.

An orthonormal basis adds that every vector has length 1. Then the matrix whose columns are those vectors has a remarkable property: its inverse is its transpose. Undoing the transformation costs nothing at all, which is why orthonormal bases turn up wherever numerical stability matters.

The standard basis — (1, 0) and (0, 1) — is orthonormal, which is why ordinary coordinates feel so natural.

Where this shows up

PCA finds an orthonormal basis aligned with the directions of greatest variance in the data. The orthogonality is the point: the components do not overlap, so each one describes something the others do not.

[SVD](singular_value_decomposition.html) produces two orthonormal bases, one for the input space and one for the output.

QR decomposition exists to manufacture an orthonormal basis from an arbitrary one, and least-squares solvers use it because the resulting system is far better conditioned than the direct approach.

Fourier and wavelet transforms are changes into an orthogonal basis chosen so the interesting structure shows up in a few coordinates.

Where it goes wrong

Nearly dependent vectors. A determinant of exactly zero is easy to spot; a determinant of 0.001 is the same problem wearing a disguise. The basis still technically works, and everything computed in it is numerically unstable. The [condition number](singular_value_decomposition.html) is how you measure it.

Assuming orthogonal means independent. It does — orthogonal non-zero vectors are always independent. The converse fails, and that is the direction people assume.

Forgetting to normalise. Orthogonal gives you the easy inverse only when the vectors also have length 1.

Check yourself

0 of 3

Answer without scrolling back up.

  1. Two vectors in the plane have determinant zero. What do they span?

  2. What does an orthonormal basis buy you?

  3. Why is a determinant of 0.001 a problem even though it is not zero?

Cheat sheet

Basis, Span and Orthogonality

Given some vectors, the span is every point you can reach by scaling them and adding the results. Nothing more exotic than that: pick a multiple of each, add them up, and see where you land.

MATHS · vizlearn.in/maths/basis_span_and_orthogonality.html

About the author

Ashish Jangra builds and maintains VizLearn. Every module here is written and the visualisation behind it hand-built, so the numbers in a readout come from the same code that draws the picture. Corrections are genuinely welcome and get priority over everything else — if a page states something wrong, or an animation misrepresents what the algorithm does, get in touch.