Change of basis when the basis aren't square

If I have a basis

$$B=\{(1,2,0,1), (0,8,0,7), (0,0,1,0)\}$$

and an orthogonal basis (which I obtained from $B$)

$$W = \{(1,2,0,1), (-23, 2, 0, 19), (0,0,1,0)\}$$

How would I calculate the change of basis matrix from $B$ to $W$? (I'd usually use the inverse matrix formula, but I can't because $W$ is not square)


Let $b_1=(1,2,0,1)$, $b_2(0,8,0,7)$, and $b_3=(0,0,1,0)$, so that $B=\{b_1,b_2,b_3\}$. Then\begin{align}(1,2,0,1)&=1b_1+0b_2+0b_2\\(−23,2,0,19)&=-23b_1+6b_2+0b_3\\(0,0,1,0)&=0b_1+0b_2+1b_3,\end{align}and therefore the change of basis matrix from $W$ to $B$ is$$\begin{bmatrix}1&-23&0\\0&6&0\\0&0&1\end{bmatrix}.$$So, the change of basis matrix from $B$ to $W$ is$$\begin{bmatrix}1&-23&0\\0&6&0\\0&0&1\end{bmatrix}^{-1}=\begin{bmatrix}1&\frac{23}6&0\\0&\frac16&0\\0&0&1\end{bmatrix}$$