# Convert from one matrix to another

I have this 4x4 matrix A:

a, b, c, 0,
e, f, g, 0,
i, j, k, 0,
0, 0, 0, 1


And I want to convert it to this matrix B:

a, c, b, 0,
i, k, j, 0,
e, g, f, 0,
0, 0, 0, 1


What matrix do I multiply A to get B? And what is the general approach I could use to "divide" B by A?

That is, corresponding to "most" (but not all) square matrices $$A$$ there is some unique matrix $$M$$ (which we name $$A^{-1}$$) such that $$A A^{-1} = A^{-1} A = I$$ whher $$I$$ is the identity matrix (ones on the diagonal, zeros elsewhere). The exception is that if the determinant of $$A$$ is zero, then it will not have an inverse.
It is straightforward but messy to find the inverse of a matrix such as your given $$A$$. Look up Gaussian elimination for one easily understood technique. The answer for your case will be something like $$A^{-1} = \frac1{\det A} \pmatrix{fk-gj & gi-ek & ce - ag &0 \\ cj-bk & af-eb & ce-ag & 0 \\ cj-eb & ja-ib & ak-ic & 0 \\ 0&0&0&1 }$$
Now use the fact that $$(BA^{-1}) A = B$$ so that $$(BA^{-1})$$ is the matrix you are looking for if you wand to multiply from the left. From the right it would be $$(A^{-1}B)$$ and in general those are not the same.