# cofactor booyashaka

This topic is 4493 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 ?
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);
}}
}



1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 13
• 9
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
633330
• Total Posts
3011388
• ### Who's Online (See full list)

There are no registered users currently online

×