Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Inverse of a Matrix

This topic is 6959 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone. I need some help. I have forgotten how to inver a 4x4 matrix. I remember how to inver a 2x2 and a 3x3, but a 4x4 (or an NxN for that matter) uses a different algorithm. Any replies (relevant) will be greatly appreciated.

Share this post

Link to post
Share on other sites
Actually we just talked about this is the rotation about an arbitrary axis thread.

Do you know how to do a Gauss-Jordan reduction on a matrix?

If so, in order to calculate the inverse of an n x n matrix you can simply create a new matrix with the n x 2n matrix with the right square being the matrix to be inverted and the left square being the n x n identity matrix, and perform a gaussian reduction on the matrix.

So if you want to invert:
[1 2 3]
[1 4 9]
[1 1 1]
create a matrix:
[1 2 3 1 0 0]
[1 4 9 0 1 0]
[1 1 1 0 0 1]
And perform the reduction and you''d get:
[1 0 0 -2.5 .5 3]
[0 1 0 4.0 -1 -3]
[0 0 1 -1.5 .5 1]

And the matrix
[-2.5 .5 3]
[4.0 -1 -3]
[-1.5 .5 1]
is the inverse.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!