I implemented inversion using Gaussian elimination, which I think is much easier than the determinant method used in the book.

It brings back my old memory in College where I first learned matrix operations. Back then, most of us had no idea why Linear Algebra necessary for Computer Science. And I didn’t pay too much attention to it other than trying to pass my exams. Luckily, I understood all basic concepts.

Input 4x4 Matrix

Transpose:

Inverse: