Réponse acceptée !
c bon j'ai trouvé, voici le code si quelqu'un est interessé:
void InvMatrixFunc(double Matrix[4][4])
{
double t[6]={0,0,0,0,0,0};
double CoffactMatrix [4][4];
double td;
// calcul des cofacteurs de la ligne 1
t[0]=Matrix[2][2]*Matrix[3][3] - Matrix[3][2]*Matrix[2][3];
t[1]=Matrix[2][1]*Matrix[3][3] - Matrix[3][1]*Matrix[2][3];
t[2]=Matrix[2][1]*Matrix[3][2] - Matrix[3][1]*Matrix[2][2];
t[3]=Matrix[2][0]*Matrix[3][3] - Matrix[3][0]*Matrix[2][3];
t[4]=Matrix[2][0]*Matrix[3][2] - Matrix[3][0]*Matrix[2][2];
t[5]=Matrix[2][0]*Matrix[3][1] - Matrix[3][0]*Matrix[2][1];
CoffactMatrix[0][0]=Matrix[1][1]*t[0] - Matrix[1][2]*t[1] + Matrix[1][3]*t[2];
CoffactMatrix[0][1]=Matrix[1][0]*t[0] - Matrix[1][2]*t[3] + Matrix[1][3]*t[4];
CoffactMatrix[0][2]=Matrix[1][0]*t[1] - Matrix[1][1]*t[3] + Matrix[1][3]*t[5];
CoffactMatrix[0][3]=Matrix[1][0]*t[2] - Matrix[1][1]*t[4] + Matrix[1][2]*t[5];
// calcul du determinant
td=Matrix[0][0]*CoffactMatrix[0][0] - Matrix[0][1]*CoffactMatrix[0][1] + Matrix[0][2]*CoffactMatrix[0][2] - Matrix[0][3]*CoffactMatrix[0][3];
// Form1->Edit1->Text=FloatToStr(td);
// test du determiant : si non nul on continue
if(td==0)
{
cout<<"\ndeterminant null!!!"<
|