Change of Basis (Transition) Matrix Calculator
Calculate the transition matrix used to convert vector coordinates from one basis to another. A change-of-basis matrix represents the same vector using a different coordinate system, with the result depending on the order of the source and destination bases.
B
C
Learn About Change of Basis (Transition) Matrix
In linear algebra, a basis provides a coordinate frame for an $n$-dimensional vector space $V$. While a geometric vector $\mathbf{x} \in V$ remains fixed in space, its numerical description changes when referenced to different bases.
Let $\mathcal{B} = \{\mathbf{b}_1, \mathbf{b}_2, \dots, \mathbf{b}_n\}$ and $\mathcal{C} = \{\mathbf{c}_1, \mathbf{c}_2, \dots, \mathbf{c}_n\}$ be two ordered bases for $\mathbb{R}^n$. Any vector $\mathbf{x}$ can be written uniquely as a linear combination in each basis:
The transition matrix from $\mathcal{B}$ to $\mathcal{C}$, denoted $\mathbf{P}_{\mathcal{B} \to \mathcal{C}}$ (or $\underset{\mathcal{C} \leftarrow \mathcal{B}}{\mathbf{P}}$), is the unique invertible $n \times n$ matrix that maps $\mathcal{B}$-coordinates directly into $\mathcal{C}$-coordinates:
Column-by-Column Construction
The columns of $\mathbf{P}_{\mathcal{B} \to \mathcal{C}}$ are the coordinate vectors of the original basis vectors $\mathbf{b}_j$ expressed relative to the target basis $\mathcal{C}$:
When basis vectors are expressed in the standard Euclidean basis $\mathcal{E}$, let $\mathbf{B} = \begin{bmatrix} \mathbf{b}_1 & \cdots & \mathbf{b}_n \end{bmatrix}$ and $\mathbf{C} = \begin{bmatrix} \mathbf{c}_1 & \cdots & \mathbf{c}_n \end{bmatrix}$. Then:
Therefore:
Efficient Calculation via Gauss-Jordan Elimination
Computing $\mathbf{C}^{-1}$ explicitly is computationally wasteful. Instead, Gauss-Jordan elimination row reduces the augmented matrix $[\mathbf{C} \mid \mathbf{B}]$:
This simultaneous reduction solves the $n$ vector systems $\mathbf{C}[\mathbf{b}_j]_\mathcal{C} = \mathbf{b}_j$ in a single sweep.
Essential Properties
- Reversibility: The transition matrix in the reverse direction is the exact matrix inverse:
- Chain Rule (Transitivity): For three bases $\mathcal{B}, \mathcal{C}, \mathcal{D}$:
- Linear Operator Transformation: A linear operator represented by matrix $\mathbf{A}_\mathcal{B}$ in basis $\mathcal{B}$ transforms into basis $\mathcal{C}$ via similarity:
Worked Numerical Example
Find the transition matrix $\mathbf{P}_{\mathcal{B} \to \mathcal{C}}$ from basis $\mathcal{B}$ to basis $\mathcal{C}$ in $\mathbb{R}^2$:
- Set Up Basis Matrices:
Check invertibility: $\det(\mathbf{B}) = 2(1) - 1(1) = 1 \ne 0$ and $\det(\mathbf{C}) = 1(2) - 1(0) = 2 \ne 0$. Both are valid bases.
- Form the Augmented Matrix $[\mathbf{C} \mid \mathbf{B}]$:
- Row Reduce to RREF:
- Scale Row 2 by $\frac{1}{2}$ ($R_2 \leftarrow \frac{1}{2}R_2$):
- Eliminate entry above pivot ($R_1 \leftarrow R_1 - R_2$):
- Extract Transition Matrix:
- Verify with a Vector:
Let $\mathbf{x} = \begin{bmatrix} 3 \\ 2 \end{bmatrix} = 1\mathbf{b}_1 + 1\mathbf{b}_2 \implies [\mathbf{x}]_\mathcal{B} = \begin{bmatrix} 1 \\ 1 \end{bmatrix}$.
Check in $\mathcal{C}$: $2\mathbf{c}_1 + 1\mathbf{c}_2 = 2\begin{bmatrix} 1 \\ 0 \end{bmatrix} + 1\begin{bmatrix} 1 \\ 2 \end{bmatrix} = \begin{bmatrix} 3 \\ 2 \end{bmatrix} = \mathbf{x}$. The coordinates match identically.
How is this different from a Markov chain transition matrix?
In linear algebra, a transition matrix performs a geometric change of coordinates between two vector bases. In probability theory, a Markov transition matrix contains conditional state-transition probabilities whose rows (or columns) sum to 1. They share the word "transition" but represent entirely different mathematical concepts.
Why must the destination matrix C be invertible?
The destination matrix $\mathbf{C}$ contains the basis vectors of $\mathcal{C}$ as its columns. For $\mathcal{C}$ to form a valid basis of $\mathbb{R}^n$, its vectors must be linearly independent and span $\mathbb{R}^n$. If $\det(\mathbf{C}) = 0$, the vectors are linearly dependent, cannot provide unique coordinates, and cannot be inverted.
How do I reverse the change of basis from C to B?
To convert coordinates in the reverse direction ($[\mathbf{x}]_\mathcal{B} = \mathbf{P}_{\mathcal{C} \to \mathcal{B}}[\mathbf{x}]_\mathcal{C}$), simply compute the matrix inverse of the forward transition matrix: $\mathbf{P}_{\mathcal{C} \to \mathcal{B}} = (\mathbf{P}_{\mathcal{B} \to \mathcal{C}})^{-1} = \mathbf{B}^{-1}\mathbf{C}$.
How does change of basis relate to matrix diagonalization?
Diagonalization $\mathbf{A} = \mathbf{P}\mathbf{D}\mathbf{P}^{-1}$ is a change of basis where the destination basis $\mathcal{C}$ is formed by the eigenvectors of $\mathbf{A}$. Relative to this eigenvector basis, the transformation matrix is purely diagonal ($\mathbf{D}$), meaning the operator stretches along the coordinate axes without coupling variables.
- Active vs. Passive Transformations: In physics, a change of basis is a passive transformation: the physical system remains unaltered while the observer's frame of reference rotates or scales. Conversely, applying a matrix to move a physical vector within the same coordinate frame is an active transformation.
- 3D Computer Graphics View Frustum: Every video game engine relies on chains of change-of-basis matrices: Model Space $\to$ World Space $\to$ Camera (Eye) Space $\to$ Clip Space. When you move the camera in a game, the graphics pipeline recalculates the view transition matrix $\mathbf{V} = \mathbf{C}^{-1}\mathbf{W}$.