Changing a vector's basis can be done using *vector projections* or *matrix transformations*. They are equivalent when the basis vectors are [[Linearly Independent Vectors]].
## Changing Basis in Vector Form
Let the vector $r_e$ in the standard basis vectors $(e_i, e_j)$ be:
$
r_e = \begin{bmatrix} 3 \\ 4 \end{bmatrix}, \quad
e_1= \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \quad
e_2= \begin{bmatrix} 0 \\ 1 \end{bmatrix} $
Suppose we want to express $r_e$ in terms of new basis vectors $(b_1, b_2)$:
$
b_1= \begin{bmatrix} 2 \\ 1 \end{bmatrix}, \quad
b_2= \begin{bmatrix} -2 \\ \phantom-4 \end{bmatrix}
$
![[basis-vectors-1.png|center|350]]
*Step 1: Check Orthogonality of New Basis Vectors*
To apply vector projection for this re-indexation, the new basis vectors $b_1, b_2$ must be orthogonal. This is the case when the [[Dot Product]] equals zero.
$ b_1 \cdot b_2= \begin{bmatrix} 2 \\ 1 \end{bmatrix} \cdot \begin{bmatrix} -2 \\ \phantom-4 \end{bmatrix}=2*(-2)+1*4=0 $
*Step 2: Project Vector onto New Basis*
We use scalar projection to find the length of the components of $r_e$ along each dimension $b_1$ and $b_2$.
$
\lvert \text{adj}_1 \rvert =\frac{b_1 \cdot r_e}{\lvert b_1 \rvert}, \quad
\lvert \text{adj}_2 \rvert =\frac{b_2 \cdot r_e}{\lvert b_2 \rvert}
$
Projection onto $b_1$:
$ \vert \text{adj}_1 \vert = \frac{\begin{bmatrix}2 \\1\end{bmatrix} \cdot \begin{bmatrix}3 \\ 4\end{bmatrix}}{2^2+1^2} = \frac{10}{\sqrt 5}$
Projection onto $b_2$:
$
\vert \text{adj}_2 \vert =
\frac{\begin{bmatrix}-2 \\\phantom{..}4\end{bmatrix} \cdot \begin{bmatrix}3 \\4 \end{bmatrix}}{-2^2+4^2} = \frac{10}{\sqrt {20}} $
*Step 3: Express Vector in the new Basis*
Dividing the [[Vector Length]] of e.g. $\text{adj}_1$ by the length of the new basis vectors $b_1$, tells us what fraction of $b_1$ we have to go along $b_1$.
$ r_b = \begin{bmatrix}
\frac{10}{\sqrt 5} * \frac{1}{\sqrt 5}\\[6pt]
\frac{10}{\sqrt {20}} * \frac{1}{\sqrt {20}} \end{bmatrix} =
\begin{bmatrix} 2\\ 0.5 \end{bmatrix} $
We get that the vector $r$ expressed in basis vectors $(b_1, b_2)$ point:
- $2$ units of $b_1$ into direction of $b_1$
- $0.5$ units of $b_2$ into direction of $b_2$
## Changing Basis in Matrix Form
When we introduce a new set of basis vectors $b_1, b_2$, we can represent them as columns of a matrix $\mathbf B$.
$
b_1 = \begin{bmatrix} 2 \\ 10\end{bmatrix}, \quad
b_2 = \begin{bmatrix} 3 \\ 1\end{bmatrix}, \quad
\mathbf B= \begin{bmatrix} 2 & 3 \\ 10 & 1 \end{bmatrix}
$
**From New Basis to Standard Basis:**
To re-express a vector $r_b$ (with basis $b_1, b_2$) in terms of standard [[Basis Vectors]], we multiply the matrix $\mathbf B$ with $r_b$.
$ r_e= \mathbf Br_b$
For example:
$
r_b=\begin{bmatrix}3\\2\end{bmatrix}, \quad
r_e=\mathbf B r_b = \begin{bmatrix} 2 & 3 \\ 10 & 1 \end{bmatrix}* \begin{bmatrix} 3 \\2 \end{bmatrix} =
\begin{bmatrix} 12 \\32 \end{bmatrix} $
**From Standard Basis to New Basis:**
When we have a vector $r_e$ (with standard Basis vectors), and need to re-express it in terms of the new basis, we multiply it with the [[Inverse Matrix]] of $\mathbf B$.
$r_b= \mathbf B^{-1}r_e$
For example:
$
r_e=\begin{bmatrix}3\\2\end{bmatrix}, \quad
r_b=\mathbf B^{-1} r_e = \frac{1}{\det (\mathbf B)}*\begin{bmatrix} 1 & -3 \\ -10 & 2 \end{bmatrix}* \begin{bmatrix} 3 \\2 \end{bmatrix}$
>[!note:]
>In contrast to vector projection, this approach also works when the new basis vectors are not orthogonal.