From Xcode documentation
InverseMatrix
Creates a new matrix that is the inverse of a specified matrix.
Boolean InverseMatrix (
const MatrixRecord *m,
MatrixRecord *im
);
and
MatrixRecord
Contains a transformation matrix.
struct MatrixRecord {
Fixed matrix[3][3];
};
but this is not enough information for me to invert a matrix. I can define matrices and fill them but I can't call InverseMatrix properly.
One attempt which didn't work
#include <iostream>
#include "function.h"
#include <ImageCompression.h>
int main (int argc, char * const argv[]) {
// insert code here...
int i, j;
struct MatrixRecord {
Fixed matrix[3][3];
Fixed imatrix[3][3];
} m;
for (i = 0; i < 3; i++)
for(j=0; j<3; j++)
m.matrix[j] = i*j;
InverseMatrix( m.matrix, m.imatrix);
return 0;
}
Error cannot convert Fixed (*)[3] to const MatrixRecord*
No surprise there
help.
thanks.
InverseMatrix
Creates a new matrix that is the inverse of a specified matrix.
Boolean InverseMatrix (
const MatrixRecord *m,
MatrixRecord *im
);
and
MatrixRecord
Contains a transformation matrix.
struct MatrixRecord {
Fixed matrix[3][3];
};
but this is not enough information for me to invert a matrix. I can define matrices and fill them but I can't call InverseMatrix properly.
One attempt which didn't work
#include <iostream>
#include "function.h"
#include <ImageCompression.h>
int main (int argc, char * const argv[]) {
// insert code here...
int i, j;
struct MatrixRecord {
Fixed matrix[3][3];
Fixed imatrix[3][3];
} m;
for (i = 0; i < 3; i++)
for(j=0; j<3; j++)
m.matrix[j] = i*j;
InverseMatrix( m.matrix, m.imatrix);
return 0;
}
Error cannot convert Fixed (*)[3] to const MatrixRecord*
No surprise there
help.
thanks.