Jump to content
  • Advertisement
Sign in to follow this  
applesauce

matrix inverses

This topic is 4397 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

can someone help me out and give me an easy, clear formula or description for deriving the inverse of a square matrix? if it's as simple as say: (1/(x22*x11 - x12*x21))*(a 2x2 matrix), then how would i multiply a single value into size n-by-n matrix? i understand how to properly multiply two equal square matrices, but nothing else, really. i'm very lost for something that should be so simple.

Share this post


Link to post
Share on other sites
Advertisement
Finding the inverse of a matrix is not that simple. Generally you use something like Gauss-Jordan elimination (which is not a very hard algorithm). For a 2 by 2 matrix you could probably derive some simple formula.
As usuall wikipedia has more information.

Share this post


Link to post
Share on other sites
for 3x3 and 4x4s i use the adjoint method (or something like that i think it's called). it basically creates an array of cofactors, then computes the determinant. then it uses the cofactor values and determinant to build the inverse matrix. the formula isn't simple (involves cofactor expansion), and there are other methods, but for small matrices they all run at about the same speed.

see this for the formula.

Share this post


Link to post
Share on other sites
the easiest way I can think of is to use Gauss-Jordan:

keep in main that A * A^-1 = I

set up your Gauss-Jordan like so:
[ A | I ]

take the necessary steps to xfrom A to I, and after doing so, whatever is left on the right hand side (originally I) will be your A inverse.

[Edited by - Driv3MeFar on June 7, 2006 3:25:11 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Driv3MeFar
the easiest way I can think of is to use Gauss-Jordan:

keep in main that A * A^-1 = I

set up your Gauss-Jordan like so:
[ A | I ]

take the necessary steps to xfrom A to I, and after doing so, whatever is left right hand side (originally I) will be your A inverse.


Indeed. The good thing about Gauss-Jordan is how easy it is to implement in code. The method is very sequential.

Share this post


Link to post
Share on other sites
The easiest way to invert a matrix is to not have to. If you built up the matrix from simple transformations, you can build up its inverse from equally simple transformations.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!