Basis, dimension and change of coordinates
Coordinates are the address of a point. But the address depends on what you measure with. Change the base arrows and watch the address of the same point change.
Short answer. A basis is a set of base arrows that lets you describe every point in space in exactly one way. The number of arrows is the dimension. Coordinates mean "how many times you use each base arrow," so if you change the base arrows, the coordinates (the address) of the same point change. The point itself does not move.
Left column = b₁, right column = b₂. These four boxes are the change-of-coordinates matrix.
Usual coordinates of point p
(x, y) = ( , )
Type new coordinates: p moves to u·b₁ + v·b₂
(u, v) = ( , )
Drag the dark point p or the circles at the arrow tips, or change the numbers. The gray dashed path is the usual way to p (x across, then y up). The colored dashed path is the way with the new arrows (b₁ u times, then b₂ v times).
Definitions
The page below explains with two arrows in the plane, but the definitions are the same in n dimensions. V is a vector space.
- basis
- A set ℬ = {b₁, …, bₙ} of vectors in V is a basis of V if it meets both conditions below. The first says the vectors are linearly independent. The second says they span V.
- dimension
- If V has a basis of n vectors, then every basis of V has n vectors. This n is the dimension of V, written dim V. The space {0} that holds only the zero vector has dimension 0.
- standard basis
- The basis {e₁, …, eₙ} of ℝⁿ, where eᵢ has 1 in place i and 0 everywhere else. In the plane, e₁ = î = (1, 0) and e₂ = ĵ = (0, 1).
- coordinate vector
- If ℬ = {b₁, …, bₙ} is a basis of V, then each vector v in V has exactly one list c₁, …, cₙ that makes the equation below true. These numbers are the coordinates of v relative to ℬ, and the list is the coordinate vector [v]ℬ. The "new coordinates" (u, v) on this page are this.
- orthonormal basis
- A basis {b₁, …, bₙ} of ℝⁿ is orthonormal if any two different vectors in it are orthogonal and every vector in it has length 1.
1. A basis: base arrows that reach every point
You can reach a point on the plane by stretching a few arrows and adding them up (a linear combination). A set of arrows is called a basis when it passes both of these tests.
- It reaches everything. By stretching and adding, you can reach every point in the space. Textbooks say the arrows "span" the space.
- Nothing is extra. No arrow can be made by stretching and adding the others. Textbooks say the arrows are "linearly independent."
The first test means you can describe every point. The second test means there is only one way to do it. So every point gets exactly one address. If b₁ and b₂ are a basis of the plane, the formula is:
The numbers (u, v) that make this true are the new coordinates of p. They mean "go along b₁ u times and along b₂ v times, and you reach p."
On a plane, the check is easy. Two arrows are a basis if they do not lie on one line. In numbers: if b₁ = (a, c) and b₂ = (b, d), then a×d − b×c must not be 0. When it is not 0, the parallelogram the two arrows make is not flat (see determinant).
Try this. Press "Not a basis." b₂ = (4, 2) is twice b₁ = (2, 1), so the two lie on one line. p = (3, 3) is off that line, so they cannot reach it (the first test fails). Now type (2, 1) into the boxes for p. 1·b₁ + 0·b₂ is p, and so is −1·b₁ + 1·b₂. There is more than one way (the second test fails).
2. Dimension: how many arrows a basis has
There is more than one basis. On a plane, any two arrows that do not lie on one line make a basis. But every basis of the same space has the same number of arrows. That number is the dimension.
| Space | Arrows in a basis | Dimension |
|---|---|---|
| A line | 1 | 1 |
| A plane | 2 | 2 |
| The space we live in | 3 | 3 |
| Lists of n numbers (for example height, weight, age: n = 3) | n | n |
Why does a plane always need exactly 2? One arrow only reaches one line (the first test fails). With three, one of them can always be made from the other two (the second test fails). So it is exactly 2.
The standard basis. The most common basis is î = (1, 0), one step to the right, and ĵ = (0, 1), one step up. The usual coordinates (x, y) mean "î x times and ĵ y times": (x, y) = x·î + y·ĵ. The coordinates you have always used were addresses measured with these arrows.
Rank, the previous topic, is also a dimension. It is the dimension of everything you can reach by stretching and adding the columns of a matrix.
3. Coordinates count how many times you use each arrow
Look at p = (3, 3). With the usual arrows, you use î 3 times and ĵ 3 times, so the address is (3, 3). With the slanted arrows b₁ = (2, 1) and b₂ = (−1, 1), you reach p by using b₁ 2 times and b₂ once, so the address is (2, 1). Same point, different address. An address only means something once you pick the base arrows.
| Try pressing | b₁ | b₂ | New coordinates of p = (3, 3) | Why |
|---|---|---|---|---|
| Usual arrows | (1, 0) | (0, 1) | (3, 3) | Same as the usual coordinates |
| Turned 45° | (0.71, 0.71) | (−0.71, 0.71) | (4.24, 0) | p lies on the line of b₁, so b₂ is not used |
| Twice as long | (2, 0) | (0, 2) | (1.5, 1.5) | The ruler is twice as long, so the numbers are half |
| Slanted | (2, 1) | (−1, 1) | (2, 1) | b₁ 2 times, b₂ once |
| Not a basis | (2, 1) | (4, 2) | none | Both lie on one line, and p is off that line |
A longer ruler gives smaller numbers. A desk measured in centimeters is 150. In meters it is 1.5. The desk did not change. The ruler got 100 times longer, so the number got 100 times smaller. Base arrows work the same way. Press "Twice as long": p stays where it is, but its coordinates become (1.5, 1.5), half as big. If you make b₁ k times longer, u becomes 1/k as big.
Try this. ① With "Slanted," move p to (1, 2). The new coordinates are (1, 1), because b₁ + b₂ = (2 − 1, 1 + 1) = (1, 2). ② With the same arrows, type u = −1 and v = 2 into the new coordinate boxes. p moves to −1·(2, 1) + 2·(−1, 1) = (−4, 1). ③ Press "Usual arrows." The new grid lands on top of the gray grid, and both addresses become the same. ④ Drag the tip of b₁ onto the line of b₂. The new grid disappears and only one orange line is left.
4. Facts to remember
| Fact | What it means |
|---|---|
| The point stays, only the address changes | Changing the base arrows changes the numbers. The point (arrow) itself does not move |
| With a basis, the address is unique | There is only one (u, v) for each point. That is why we can call it the coordinates |
| Many bases, same count | A plane has endlessly many bases, but each one has 2 arrows. That count is the dimension |
| How to check a basis on a plane | If b₁ = (a, c) and b₂ = (b, d), it is a basis when a×d − b×c is not 0 |
| Arrows k times longer, coordinates 1/k as big | Make b₁ twice as long and u becomes half |
5. Work it out by hand
This is the starting setup of the lab. With b₁ = (2, 1) and b₂ = (−1, 1), find the new coordinates (u, v) of p = (3, 3).
- Write the equation.
u·(2, 1) + v·(−1, 1) = (3, 3) - Split it into across and up. Across:
2u − v = 3. Up:u + v = 3 - Add the two equations and v drops out.
3u = 6, sou = 2 - Put that into the "up" equation.
2 + v = 3, sov = 1 - Check.
2·(2, 1) + 1·(−1, 1) = (4 − 1, 2 + 1) = (3, 3). Correct.
The same work written as formulas:
In formulas, (2, 1) is written standing up as a column. It is the same arrow.
The new coordinates are (2, 1). The colored dashed path in the lab is exactly this: go along the green arrow 2 times, then along the blue arrow once.
6. The change-of-coordinates matrix
With a matrix, the work above fits on one line. Put b₁ and b₂ side by side as columns and call that matrix B. The four boxes in the lab are this matrix.
New coordinates to usual coordinates: multiply by B. That works because B × (u, v) = u·b₁ + v·b₂. B × (2, 1) = (2×2 + (−1)×1, 1×2 + 1×1) = (3, 3).
Usual coordinates to new coordinates: multiply by B⁻¹, the inverse of B. The inverse is the matrix that undoes what B does. For a 2×2 matrix [a b / c d], the inverse is 1/(a×d − b×c) × [d −b / −c a].
a×d − b×c = 2×1 − (−1)×1 = 3B⁻¹ = 1/3 × [1 1 / −1 2]. The[0.33 0.33 / -0.33 0.67]shown under the lab is this matrix.B⁻¹ × (3, 3) = 1/3 × (1×3 + 1×3, −1×3 + 2×3) = 1/3 × (6, 3) = (2, 1). Same answer as by hand.
The same work written as formulas:
To see where these two formulas come from, one step at a time with a picture, go to section 7 just below.
If the arrows are not a basis, a×d − b×c is 0 and there is no inverse. That is why "Not a basis" has no new coordinates.
Easy to mix up. B goes from new coordinates to usual coordinates. Books do not agree on which direction gets the name "change-of-basis matrix," so check what is in the columns.
7. How the formula is built: change of coordinates
Here is where the two formulas from section 6, p = [b₁ b₂] × (u, v) and (u, v) = [b₁ b₂]⁻¹ × p, come from, one step at a time. [b₁ b₂] is the B from section 6, the matrix with b₁ and b₂ as its columns. The numbers are the lab's starting setup, b₁ = (2, 1), b₂ = (−1, 1) and p = (3, 3). In the last step we switch to "Twice as long" to check the result. As in section 1, we write b₁ = (a, c) and b₂ = (b, d).
The green and blue dashes are the path: b₁ u times, then b₂ v times. The purple cell and point are the square cell that [b₁ b₂] carries, and the address (u, v).
Press "Next" to go one step at a time. A piece is added to the formula on top (the orange background marks the new piece), the picture changes by that much, and the reason appears below.
Written only as formulas, the steps above are these.
- b₁ u times, b₂ v times:
p = u·b₁ + v·b₂. The starting point is what new coordinates mean (section 3), written as an equation. Here (u, v) = (2, 1), so you go 2·b₁ = (4, 2) along the green dashed path, then 1·b₂ = (−1, 1) along the blue one, and you reach p = (3, 3). - Split into across and up:
p = (a·u + b·v, c·u + d·v). Stretching and adding arrows is done separately for the across parts and the up parts. In the picture, the shadows of the path drop onto the two axes. Across:2×2 + (−1)×1 = 4 − 1 = 3. Up:1×2 + 1×1 = 2 + 1 = 3. These are the same two equations as in section 5. - Matrix times vector:
p = [b₁ b₂] × (u, v). Put the two lines side by side. u is multiplied by a and c, the two numbers of b₁. v is multiplied by b and d, the two numbers of b₂. The rule for a matrix times a vector (matrix multiplication) is "for each row of the matrix, multiply it with (u, v) pair by pair and add." So if you stand b₁ in the left column and b₂ in the right column, both lines are written at once. The purple cell in the picture shows what this matrix does. The one-by-one square turns into the cell made by b₁ and b₂, and the point (2, 1) of the square grid moves to p = (3, 3). - Going back:
(u, v) = [b₁ b₂]⁻¹ × p. To get the new coordinates from the usual coordinates p, you undo what [b₁ b₂] did. The matrix that undoes it is the inverse.a×d − b×c = 3is not 0, so the inverse exists, and the formula from section 6 gives[b₁ b₂]⁻¹ = 1/3 × [1 1 / −1 2]. We do not prove that formula here. You can check it by multiplying:[2 −1 / 1 1] × 1/3 × [1 1 / −1 2] = 1/3 × [3 0 / 0 3] = [1 0 / 0 1], the matrix that changes nothing. In the picture, the purple grid straightens back into squares, and p goes to its address (2, 1). - Check and finish:
p = [b₁ b₂] × (u, v) ⇔ (u, v) = [b₁ b₂]⁻¹ × p. Switch to "Twice as long," b₁ = (2, 0) and b₂ = (0, 2). Now[b₁ b₂]⁻¹ = [0.5 0 / 0 0.5], so(u, v) = (1.5, 1.5). p did not move. Only its address got cut in half, just like "a longer ruler gives smaller numbers" in section 3. Going forward,[2 0 / 0 2] × (1.5, 1.5) = (3, 3), so each formula undoes the other. The sign ⇔ means "if one side is true, so is the other." If the arrows are not a basis (a×d − b×c = 0), there is no inverse, and the right-hand formula cannot be used.
8. Orthonormal basis: one dot product per coordinate
If the base arrows are at right angles to each other and have length 1, the basis is called orthonormal. The usual arrows î, ĵ and "Turned 45°" are both orthonormal.
Then you need no equations and no inverse. Each new coordinate is one dot product.
For example, "Turned 45°" uses b₁ = (0.71, 0.71) and b₂ = (−0.71, 0.71) (0.71 is short for 1/√2 ≈ 0.7071). With p = (3, 3): u = 3×0.7071 + 3×0.7071 ≈ 4.24 and v = 3×(−0.7071) + 3×0.7071 = 0. That matches the (4.24, 0) in the lab.
Why does this work? The dot product is the length of p's shadow on b₁, times the length of b₁. If b₁ has length 1, the dot product is just the shadow's length. And b₂ is at a right angle to b₁, so moving along b₂ does not change the shadow on b₁. So the shadow's length is u.
If the arrows are at right angles but not length 1, divide by the length squared: u = (p · b₁) ÷ (b₁ · b₁). For "Twice as long": (3, 3) · (2, 0) ÷ 4 = 6 ÷ 4 = 1.5.
For an orthonormal basis, the inverse B⁻¹ is just B with rows and columns swapped (the transpose). So undoing it costs almost nothing.
Where is it used?
- Graphics and games: local and world coordinates. A character's hand is written as "1 forward and 0.5 to the right, from the character's point of view" (local coordinates). To draw it on screen, you change it to world coordinates. The character's forward and right directions are the new base arrows. The change is the matrix multiply above, plus the character's position. When the character turns, only the base arrows change.
- Color. Screens write a color as amounts of red, green and blue (RGB). Photo and video compression writes the same color as one brightness value and two color-difference values (YCbCr). Eyes notice brightness more than color, so the color-difference part can be stored with less detail and it is hard to see. This change is a 3×3 matrix multiply plus a fixed offset.
- Principal component analysis (PCA). It builds a new orthonormal basis from the data. The first arrow points where the data is most spread out. The next one points where it is most spread out among the directions at right angles to the first, and so on. Keep only the first few coordinates and you reduce the dimension of the data.
- Eigenvectors as the base arrows. Some arrows stay on their own line when a matrix acts on them. They only get multiplied by a number. These are eigenvectors. If you use them as the base arrows, the matrix becomes simple: "this many times along b₁, that many times along b₂" (a diagonal matrix). This works when there are enough of these arrows to make a basis. See the next topic, eigenvalues and eigenvectors.
Common questions
What is a basis?
It is a set of base arrows that lets you describe every point in space in exactly one way. On a flat plane, any two arrows that do not lie on one line make a basis.
How is the dimension decided?
It is the number of arrows in a basis. Every basis of the same space has the same number of arrows, so a plane has dimension 2 and the space we live in has dimension 3.
If I change the base arrows, does the point move?
No. The point stays where it is. Only the numbers you use to write it down (the coordinates) change. A desk measured in centimeters is 150, and in meters it is 1.5. It is the same desk.
How do you calculate a change of coordinates?
To go from new coordinates to usual coordinates, multiply by the matrix whose columns are b₁ and b₂. To go from usual coordinates to new coordinates, multiply by the inverse of that matrix.
Why is an orthonormal basis handy?
If the base arrows are at right angles to each other and have length 1, each new coordinate is just one dot product with a base arrow. You do not need to solve equations or find an inverse matrix.
Words
| Word used here | Word used in textbooks |
|---|---|
| set of base arrows | basis. One arrow in it is a basis vector |
| usual arrows î, ĵ | standard basis |
| stretching and adding | linear combination |
| reaches everything | spans the space. Everything it reaches is the span |
| nothing is extra | linearly independent |
| lying on one line (something is extra) | linearly dependent |
| number of arrows in a basis | dimension. Written dim |
| address (u, v) | coordinates, coordinate vector |
| change-of-coordinates matrix B | change-of-basis matrix, transition matrix |
| arrows at right angles with length 1 | orthonormal basis |
| matrix that undoes it | inverse matrix. Written B⁻¹ |
| rows and columns swapped | transpose. Written Bᵀ |