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 each 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 often 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 make.
often — but not always. Drag one vector until it lines up with the other and the parallelogram flattens to nothing. Now each 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 didn't 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 all. Why at right angles is worth so much.
The determinant is the test
You don't have to eyeball it. The readout gives the determinant, which is the signed area of that parallelogram, and it reaches zero just when the span merges.
That is the same number the determinant module covers as an area scale factor, seen from another side. A mat whose determinant is zero squashes the plane onto a line. This Is just why it has no inverse: a few 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 free — enough to reach all, with nothing redundant.
Both halves matter. Too few vectors and you can't reach all. Too many and the form stops being unique, because there's more than one way to write the same point. A basis is the exact amount.
Once you've one, each point in the space has just one set of coords in it. That is the whole reason coords work at all, and it's why "change of basis" is a real op rather than a rearrangement.
The plane needs just two vectors in any basis. Three-dimensional space needs three. That count is the dim, and it doesn't depend on which basis you choose.
Orthogonality
Two vectors are perp when their dot product is zero — the algebraic way of saying they meet at a right angle. Drag until the readout says so.
Perpness isn't needed for a basis. The default pair above is a just right good basis and is nowhere near at right angles. But an perp basis is worth reaching for, because finding the coords of a point turns a matter of taking one dot product per axis instead of solving a system of equations.
An unit-perp basis adds that each vector has length 1. Then the mat whose columns are those vectors has a remarkable property: its inverse is its transpose. Undoing the change costs nothing at all, which is why unit-perp bases turn up wherever numeric steadiness matters.
The standard basis — (1, 0) and (0, 1) — is unit-perp, which is why plain coords feel so natural.
Where this shows up
PCA finds an unit-perp basis aligned with the directions of greatest variance in the data. The perpness is the point: the components don't share, so each one shows a thing the others don't.
SVD makes two unit-perp bases, one for the input space and one for the output.
QR breakdown exists to manufacture an unit-perp basis from an any 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 perp basis chosen so the notable structure shows up in a few coords.
Coordinates, with and without orthogonality
The payoff of an perp basis is concrete: coords become dot products instead of a system of equations. Take the point p = (5, 5) and two bases.
In the plain basis b1 = (2, 1), b2 = (1, 3), finding coords c1, c2 with c1 b1 + c2 b2 = p means solving
2c1 + c2 = 5 and c1 + 3c2 = 5 → c1 = 2, c2 = 1.
That is a 2×2 system. In n dims it's an n×n solve.
In the unit-perp basis q1 = (1, 1)/√2, q2 = (1, −1)/√2, each coord is a single dot product:
coordinate
computation
value
c1
p · q1 = (5+5)/√2
≈ 7.07
c2
p · q2 = (5−5)/√2
0
No system to solve — one dot product per axis, because the axes don't interfere. This is why an unit-perp basis is worth making (that is what QR does): the mat of its vectors has its transpose as its inverse, so projecting onto it and rebuilding from it both cost a single times, and that is the property numeric methods reach for when steadiness matters.
The determinant is the warning the coords give before they fail. It's the signed area of the parallelogram the basis vectors span, and it reaches zero just when they line up and the span merges to a line — at which point most of the plane turns unreachable and no coords exist for it. A determinant of 0.001 is that same collapse nearly arrived: the basis still strictly works, but rebuilding a point from its coords cuts by that tiny number and amplifies each rounding error. This Is the numeric face of the near-dependence an unit-perp basis is built to avoid.
Where it goes wrong with Basis, Span and Orthogonality
Nearly dependent vectors. A determinant of just zero is easy to spot. A determinant of 0.001 is the same problem wearing a disguise. The basis still strictly works, and all found in it's by number unstable. The rule number is how you measure it.
given perp means free. It does — perp non-zero vectors are always free. The converse fails, and that is the direction people assume.
Losing to norm. perp gives you the easy inverse only when the vectors also have length 1.
Questions people ask about Basis, Span and Orthogonality
What is the span of a set of vectors? It is every vector you can reach by scaling the set and adding the results. Two independent vectors in 3D span a plane, not the whole space.
How do I tell whether vectors are linearly independent? Put them in a matrix as columns and check its rank, or its determinant when the matrix is square. Full rank means independent.
What makes a set of vectors a basis? They must be linearly independent and span the space. That gives each vector in the space exactly one set of coordinates.
Are orthogonal vectors always independent? Yes, provided none of them is the zero vector. Nonzero orthogonal vectors can never be written in terms of one another.
Why prefer an orthonormal basis? Coordinates become plain dot products, with no system to solve, and lengths and angles are preserved. That is why PCA, QR and SVD all aim for one.
Does a vector space have one basis or many? Many, but they all contain the same number of vectors. That count is the dimension of the space.
Same vector, three different bases
coords only mean a thing scaled to a basis. Here one fixed vector is written in three of them. An unit-perp basis makes the math trivial.
example_01.pyNumPy
import numpy as np
v = np.array([5.0, 3.0])
bases = {
"standard e1,e2": np.array([[1.0, 0.0], [0.0, 1.0]]),
"sheared (non-orth.)": np.array([[1.0, 0.0], [1.0, 1.0]]),
"rotated 45 (orthon.)": np.array([[1, 1], [-1, 1]]) / np.sqrt(2),
}
for name, B in bases.items():
# columns of B are the basis vectors; solve B @ coords = v
coords = np.linalg.solve(B, v)
print("%-22s coords %s rebuilt %s"
% (name, np.round(coords, 4), np.round(B @ coords, 4)))
print()
B = bases["rotated 45 (orthon.)"]
print("orthonormal means B.T @ B is the identity:")
print(np.round(B.T @ B, 10))
print()
print("so the coordinates are just dot products -- no solve needed:")
print(" solve ", np.round(np.linalg.solve(B, v), 6))
print(" B.T @ v ", np.round(B.T @ v, 6))
print()
print("span: two vectors that point the same way span only a line.")
for pair, label in (([[1, 0], [0, 1]], "independent"),
([[1, 2], [2, 4]], "one is twice the other")):
M = np.array(pair, dtype=float)
print(" %-24s rank %d -> spans %dD"
% (label, np.linalg.matrix_rank(M), np.linalg.matrix_rank(M)))
Output
Check yourself
0 of 3
Answer without scrolling back up.
Two vectors in the plane have determinant zero. What do they span?
The parallelogram has collapsed, so one vector is a multiple of the other and adds no new direction. Every combination lands on one line.
What does an orthonormal basis buy you?
Undoing the transformation becomes free, which is why orthonormal bases turn up wherever numerical stability matters.
Why is a determinant of 0.001 a problem even though it is not zero?
Exact zero is easy to catch. Nearly zero is the same problem in disguise, and the condition number is how it is measured.
Cheat sheet
Basis, Span and Orthogonality
Add vectors to a set and watch the span grow. See why orthogonal bases make projections simple and what happens when vectors depend.
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.