Go to the source code of this file.
Functions | |
int | mdcTwoInv (double matrix[3], double invmat[3]) |
int mdcTwoInv | ( | double | matrix[3], | |
double | invmat[3] | |||
) |
Definition at line 3 of file mdcTwoInv.cxx.
00003 { 00004 00005 /* Declare variables. */ 00006 double det, detinv; 00007 00008 /**************************************************************************/ 00009 00010 det = matrix[0] * matrix[2] - matrix[1] * matrix[1]; 00011 if (det == 0.0) { 00012 invmat[0] = 0.00001; 00013 invmat[2] = 0.00001; 00014 invmat[1] = 0.00000; 00015 return 1; 00016 } 00017 detinv = 1./det; 00018 00019 invmat[0] = matrix[2] * detinv; 00020 invmat[2] = matrix[0] * detinv; 00021 invmat[1] = -matrix[1] * detinv; 00022 00023 return 0; 00024 }