ZestCalc

Change of Basis Calculator

The same point has different coordinates in different bases. Convert between them exactly, find the transition matrix, and see the point on each grid.

Bases and coordinates

Enter basis B, basis C, and a point's coordinates in B. Each basis needs one vector per entry.

Entries2
b1=b_{1} =
b2=b_{2} =
c1=c_{1} =
c2=c_{2} =
[x]B=[x]_B =

Result

Updates as you type.

Transition matrix

PC←B=[1−111]P_{C \leftarrow B} = \begin{bmatrix} 1 & -1 \\ 1 & 1 \end{bmatrix}
Coordinates in C
[x]C=(1, 3)[x]_C = \left(1,\ 3\right)
Standard coordinates
x=B[x]B=(1, 3)x = B[x]_B = \left(1,\ 3\right)
Check
C[x]C=(1, 3)C[x]_C = \left(1,\ 3\right)

These all name one point. Only the grid it's measured on changes.

The way back

PB←C=[1212−1212]P_{B \leftarrow C} = \begin{bmatrix} \frac{1}{2} & \frac{1}{2} \\ -\frac{1}{2} & \frac{1}{2} \end{bmatrix}

What a basis does

A basis is a set of independent vectors that can reach every point in the space, each in exactly one way. You can check independence with the Linear Independence and Span Calculator. A point's coordinates in a basis are the amounts of each basis vector that reach it:

x=a1b1+a2b2+⋯+anbnx = a_1 b_1 + a_2 b_2 + \cdots + a_n b_n

The usual (x,y)(x, y) coordinates are coordinates in the standard basis, whose vectors point along the axes. Another basis gives the same point different numbers, in the same way that one distance has different values in miles and kilometers.

The transition matrix

To convert from basis BB to basis CC, write the basis vectors as the columns of matrices BB and CC. Both coordinate lists describe one point, so:

C [x]C=B [x]BC\,[x]_C = B\,[x]_B

Solving for [x]C[x]_C gives the transition matrix PP:

[x]C=P [x]B,P=C−1B[x]_C = P\,[x]_B, \qquad P = C^{-1} B

Each column of PP is one vector of BB written in the basis CC. Going the other way uses its inverse, which you can find with the Matrix Inverse Calculator.

Why change basis

A good basis can make a hard problem easy. Along the eigenvectors of a matrix, for example, the matrix only stretches, and that's the idea behind the Matrix Diagonalization Calculator. Other common uses:

  • Computer graphics. Each object has its own coordinates, which are converted to those of the scene and the camera.
  • Compression. JPEG images change basis so that most coefficients become small enough to drop.
  • Physics. Choosing axes along a slope makes the forces on an object simpler to write.

The same idea applies to matrices. A Linear Transformation Visualizer shows what a matrix does in the standard basis, and P−1APP^{-1} A P describes that same transformation in another.