Inverse of 3x3 and up matrices

Started by
2 comments, last by GameDev.net 20 years, 2 months ago
How do you find the inverse of a 3x3 matrix and up (meaning bigger dimensions like 4x4, 5x5) with pencil and paper? I know how to do it with a 2x2 matrix by the book. Find the determinant which is ad-bc assuming the matrix :

[a b]
[c d]
 
then the inverse is:

[(d/(ad-bc)) (-b/(ad-bc))]
[(-c/(ad-bc)) (a/(ad-bc))]
 
I''ve been just using my calculator for 3x3 calculations and up because there has been nothing in my book so I''m assuming that I really don''t need to know this but I want to know what''s going behind the scenes in the calculator. This is not a homework question I''m expanding my knowledge on the feeble base that I already have. Thanks in advance. Charles Hwang -aka Tazel [Maxedge My Site(UC)|E-mail|NeXe|NeHe|SDL] [Google|Dev-C++|GDArticles|C++.com|MSDN]
Advertisement
Gauss-Jordan Elimination is one method.

Thanks Salsa!Colin Jeanne | Invader''s Realm
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud
Lol...perhaps that''s why that they didn''t include it in my textbook!!! I''m glad they didn''t!

Charles Hwang -aka Tazel
[Maxedge My Site(UC)|E-mail|NeXe|NeHe|SDL]
[Google|Dev-C++|GDArticles|C++.com|MSDN]
A sophisticated computer program for solving systems of equations could use elimination and pivoting (switching around rows and/or columns) to factor the matrix into upper and lower triangular matrixes, and then use these matrices to solve systems rather than explicitly calculating the inverse matrix.

Ax = b

becomes

LUx = b

where L is a lower triangular matrix that looks something like:

x 0 0 0 0
x x 0 0 0
x x x 0 0
x x x x 0
x x x x x

where the x''s could be any number (it depends on the matrix that was factored). Everything above the main diagonal is 0.

and U is an upper diagonal matrix, where everything below the main diagonal is 0.

Any nonsingular square matrix can be factored like this. The factorization is then used to solve the system by doing the following:

let y = Ux
solve Ly = b
solve Ux = y

Solving both of those systems is easy because of the triangular structure of the matrices; straightforward substitution can be used.

There are also iterative methods for solving systems, where in each iteration a closer approximation to the solution is found. The program can just keep iterating until the solution is within the desired tolerance.

This topic is closed to new replies.

Advertisement