Thread: Very handy matrix functions - part 1

  1. #1
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607

    Very handy matrix functions - part 1

    I finished reading my 3D math book and let me tell you it was full of information that I've been searching for...for a very long time.

    Granted the D3DX library of functions can do most anything with matrices but it is nice to know the math behind it.

    For instance...here is how to find the determinant of a 2D matrix.

    [m11 m12]
    [m21 m22]

    d=((m11m22)-(m12m21))

    So for a 3x3 would be:

    [m11 m12 m13]
    [m21 m22 m23]
    [m31 m32 m33]

    ((m11m22m33)+(m12m23m31)+(m13m21m32))-
    ((m13m22m31)+(m12m21m33)+(m11m23m32))

    But this changes for a nxn matrix.

    Essentially you must divide the matrix up into submatrixes called cofactors. Take the sum of all the determinants of the cofactors and you have the determinant of the matrix.

    Here is an example of a cofactor:

    [m11 m12 m13]
    [m21 m22 m23]
    [m31 m32 m33]

    C11=
    [m22 m23]
    [m32 m33]

    :C11:=(m22m33)-(m23m32)

    So:
    :C11:+
    :C12:+
    :C13:+
    :C21:+
    :C22:+
    :C23:+
    :C31:+
    :C32:+
    :C33:=
    :M:

  2. #2
    Shadow12345
    Guest
    Can you explain why matrices work in the first place? I've read all of the formulas and theorems for matrices, but I still don't understand why multiplying matrices together means anything, why taking the inverse or finding the determinants means anything. This is the part of mathematics that I hate: when things just appear out of nowhere and just 'magically' work. I hesitated to implement a matrix system because I didn't know why they work, and I still don't understand them at a very fundamental level.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C program - inverse of a matrix
    By chaugh in forum C Programming
    Replies: 4
    Last Post: 01-18-2010, 11:00 PM
  2. Matrix Multiplication ( Accessing data from a file ) HELP
    By six_degreez in forum C Programming
    Replies: 2
    Last Post: 07-24-2008, 05:21 PM
  3. getting orientation and position in opengl
    By ting in forum Game Programming
    Replies: 9
    Last Post: 07-07-2008, 04:13 PM
  4. Very handy matrix functions - part 1
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 05-20-2004, 10:38 AM