### Author Topic: Invert Matrix  (Read 1489 times)

0 Members and 1 Guest are viewing this topic.

#### chill

• Triple Ace
• Posts: 182
• Karma: +1/-0
##### Invert Matrix
« on: 25 December, 2004, 13:54:36 »
there are 2 ways of inverting a matrix one
is
using  sub determinats
other is the Gau?-Jordan method

and the better one is defently
the Gau?-Jordan, it can easily calculate the
inverse Matrix of a 100 x 100 matrix
whereas the sub determinats method will take hours maybe, I borke it off, maybe someone want's to try...

and to prof the calculations of the following script are right.
we do this

the inverse Matrix =  matrix^-1

now when you multiply the orginal matrix with
the inveres you get the identity matrix

e.g. for a 3 x 3
1 0 0
0 1 0
0 0 1

so what we do is something like

m1 = Matrix:Create( 10, 10 )
m1:fillrandom( -5, 5 )

m1:draw()

m2 = m1^-1

m2: draw()

m3 = m2 * m1

m3:draw()

if m3 is a Identymatrix then the calcualtion was correct

now when we do
m1 = Matrix:Create( 100, 100 )
we get a 100 x 100 matrix to try the same

here  the code
using Gau?-Jordan

here  the code using sub detreminats

#### PtokaX forum

##### Invert Matrix
« on: 25 December, 2004, 13:54:36 »