i have been trying to get the correct code for a 3x3 matrix and upon checking for information from the net, i realised it was almost like my code..i mean the logic was the same but when i run it, i get a random negative number which is far from the answer.
Below is the code snippet for that portion:
i hope i can get help from here
Below is the code snippet for that portion:
Code:
double determinant =(x[0][0]*x[1][1]*x[2][2]) + (x[0][1]*x[1][2]*x[2][0]) + (x[0][2]*x[1][0]*x[2][1]) -
(x[0][0]*x[1][2]*x[2][1]) - (x[0][1]*x[1][0]*x[2][2]) -
(x[0][2]*x[1][1]*x[2][0]);
Comment