Go to the source code of this file.
|
| int | mdcTwoInv (double matrix[3], double invmat[3]) |
◆ mdcTwoInv()
| int mdcTwoInv |
( |
double | matrix[3], |
|
|
double | invmat[3] ) |
Definition at line 3 of file mdcTwoInv.cxx.
3 {
4
5
6 double det, detinv;
7
8
9
10 det = matrix[0] * matrix[2] - matrix[1] * matrix[1];
11 if ( det == 0.0 )
12 {
13 invmat[0] = 0.00001;
14 invmat[2] = 0.00001;
15 invmat[1] = 0.00000;
16 return 1;
17 }
18 detinv = 1. / det;
19
20 invmat[0] = matrix[2] * detinv;
21 invmat[2] = matrix[0] * detinv;
22 invmat[1] = -matrix[1] * detinv;
23
24 return 0;
25}