float MatrixCofactor(Matrix &jug, int row, int col){
Matrix naix;
int counterr = 0;
int counterc = 0;
for(int i = 0; i < 3; i++){
for(int j = 0; j < 3; j++){
if((row != i) && (col != j)){
naix.m33[counterr][counterc] = jug.m33[j];
counterc++;
}
if(row == j){
counterr++;
counterc = 0;}
}}
float leo = {( naix.m33[0][0] * naix.m33[1][1] * naix.m33[2][2])
+(naix.m33[0][1] * naix.m33[1][2] * naix.m33[2][0])
+(naix.m33[0][2] * naix.m33[1][0] * naix.m33[2][1])
-(naix.m33[0][0] * naix.m33[1][2] * naix.m33[2][1])
-(naix.m33[0][1] * naix.m33[1][0] * naix.m33[2][2])
-(naix.m33[0][2] * naix.m33[1][1] * naix.m33[2][2])};
return leo;
}
void XcoFactor(Matrix &jug){
Matrix tmp;
int col = 0;
int row = 0;
CopyMatrix(jug, tmp);
for(row = 0; row < 4; row++){
for(col = 0; col < 4; col++){
jug.m33[row][col] = MatrixCofactor(tmp, row, col);
}}
}
cofactor booyashaka
I got this cofactor working without errors and i get a numbers back.
Is there a way you can tell your getting the correct numbers back.
Cuz they dont look right ?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement