Created
May 29, 2017 06:51
-
-
Save sanket143/c6d4200f2c513200f1b5ec423cb8b1f9 to your computer and use it in GitHub Desktop.
To get determinant of 3*3 matrix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var matrix=[]; | |
function Solve(matrix) { | |
var Det = matrix[0][0]*(matrix[1][1]*matrix[2][2] - matrix[1][2]*matrix[2][1])-matrix[0][1]*(matrix[1][0]*matrix[1][1]-matrix[1][2]*matrix[2][0])+matrix[0][2]*(matrix[1][0]*matrix[2][1]-matrix[1][1]*matrix[2][0]); | |
return Det; | |
} | |
Solve([[1,2,2],[3,4,5],[4,5,6]]);//Here goes your three cross three matrix; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment