BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
mdcTwoInv.cxx File Reference

Go to the source code of this file.

Functions

int mdcTwoInv (double matrix[3], double invmat[3])
 

Function Documentation

◆ mdcTwoInv()

int mdcTwoInv ( double  matrix[3],
double  invmat[3] 
)

Definition at line 3 of file mdcTwoInv.cxx.

3 {
4
5 /* Declare variables. */
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}