>I do have some code, but it's unmanageable and inefficient at the moment.
> If you want to see it, just ask.
it would be nice to have something to work with.
¿inefficient? It's a 4x4 matrix, ¿how much could you screw up?
Using Gauss-Jordan and assuming that you do not need to change pivoting
This routine uses full pivoting and I have found it reliable. It will probably be inaccurate for near singular matrices. You need to use SVD and then least squares for that (there is also a routine for this in the book)
If you are doing geometric work then you can avoid singular matrices by considering the geometry of the situation.
I don't think routines without at least partial pivoting are useful. So its not that simple a problem.
Here's my code, no I don't understand every detail, it just works.
NB: You ask about inverses in 3D, Clearly if a 3x3 matrix represents a transformation of an object then the inverse will take it back to its original position. BUT when you are dealing with rotations (often the case) these are unit matrices, so the inverse is just the transpose (MUCH quicker to calculate). So unless you are doing unusual tranformations, code for the general inverse is not required.