# Matrices

• The size of a matrix is the number of rows and columns.
• A matrix with M rows and N columns is a MxN matrix.
• Individual elements in the matrix is referenced using two index values. The order is row first then column.
• Common matrices used are 2x2, 3x3 and 4x4.
• The major diagonal of a matrix is the elements where the row number is equal to the column number. That is Mij where i=j.
• If all non diagonal elements in a matrix is zero then the matrix is a diagonal matrix.
• The identity matrix I is a matrix that have a size of NxN and all elements i=j is set to one. All others are zero.

Transponse

• The transpose of M is known as MT. It is the c*r matrix where the columns are formed from the rows of M. It 'flips' the matrix diagonally. MTij = Mij
• (MT)T = M. The transpose of a matrix transpose is the matrix again.
• DT = D for any diagonal matrix.

Matrix Multiplying

• Multiplying a matrix M with a scalar k ( kM ) is done by multiplying each element in the matrix with the scalar.

Multiplying two matrices

• A r*n matrix A may be multiplied by a n*c matrix B. The result C is a r*c matrix. The number of columns in A needs to be the same as the number of columns in B.
• Each element Cij will be the sum of the dot product of row i in A with column j in B.
• Multiplying any matrix M with a square matrix S result in a matrix of the same size as M. If S is the identity matrix I then the result will be M.
• AB != BA

Multiplying a vector and a matrix

Determinant

• The determinant of a square matrix M is a scalar denoted |M|.
• It only exist for square matrices.
• If any row or column in a matrix is all zero then the determinant of the matrix is zero.
• ||AB|| = |A| |B|
• |MT| = |M|

Inverse

• The inverse of a square matrix M, M-1 is the matrix that when multiplied by M will result in I.
• Not all matrices have an inverse.
• A matrix that is invertible have a non zero determinant.
• MM-1 = I
• (M-1)-1 = M
• I-1 = I
• (MT)-1 = (M-1)T

Orthogonal

• A square matrix is orthogonal if the product of the matrix and it's transpose is the identity matrix. MMT = I
• If a matrix is orthogonal then the inverse and the transpose is equal. MT = M-1

Reference