Bcc.InverseMatrix({matrix})

Description

Returns the inverse matrix of the input matrix.

Parameters

The primary input of this function is a table containing the matrix information:


  • matrix - table formatted as a matrix: matrix={{1,0,0,0},{0,1,0,0},{0,0,1,0},{0,0,0,1}}

Return

Returns a matrix containing the inverse of the input matrix.


The format of the return is the following assuming you have returned to a variable named matrix:


matrix[1] = {1,0,0,0}

matrix[2] = {0,1,0,0}

matrix[3] = {0,0,1,0}

matrix[4] = {0,0,0,1}

Examples


-- Define our input matrix

matrix = {{1,0,0,0},{0,0.7071,0.7071,0},{0,-0.7071,0.7071,0},{0,0,0,1}


-- Get the inverse of the input matrix

invMatrix = Bcc.InverseMatrix(matrix)


The resulting information contained in would be:


invMatrix[1] = {1,0,0,0}

invMatrix[2] = {0,0.7071,-0.7071,0}

invMatrix[3] = {0,0.7071,0.7071,0}

invMatrix[4] = {1,0,0,0}