In the programming language of your choice write a function which determines if a 3x3 matrix is non-singular. Use remark statements to explain how the program works. You may want to use your calculator’s programming language.
int find_determinant(int (&matrix)[3][3]) { int result = 0; result += matrix[0][0] * matrix[1][1] * matrix[2][2]; result += matrix[0][1] * matrix[1][2] * matrix[2][0]; result += matrix[1][0] * matrix[2][1] * matrix[0][2];
result -= matrix[0][2] * matrix[1][1] * matrix[2][0]; result -= matrix[1][0] * matrix[0][1] * matrix[2][2]; result -= matrix[2][1] * matrix[1][2] * matrix[0][0]; return result; }
Comments
Leave a comment