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 invmat[0] = 0.00001;
13 invmat[2] = 0.00001;
14 invmat[1] = 0.00000;
15 return 1;
16 }
17 detinv = 1./det;
18
19 invmat[0] = matrix[2] * detinv;
20 invmat[2] = matrix[0] * detinv;
21 invmat[1] = -matrix[1] * detinv;
22
23 return 0;
24}