Skip to content

Instantly share code, notes, and snippets.

@sanket143
Created May 29, 2017 05:42
Show Gist options
  • Save sanket143/61feb2e10b25dd1ee0cf993b3549b88b to your computer and use it in GitHub Desktop.
Save sanket143/61feb2e10b25dd1ee0cf993b3549b88b to your computer and use it in GitHub Desktop.
To calculate determinant of 2*2 matrix
var matrix = [];
function Solve(matrix) {
var Det = matrix[0][0]*matrix[1][1] - matrix[0][1]*matrix[1][0];
return Det;
}
Solve([[1,2],
[3,4]]); // Here goes your matrix and you'll got you determinant;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment