EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairGeoMatrix.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairGeoMatrix.cxx
1 //*-- Author : M. Sanchez
2 //*-- Modified : 07.03.2001
3 
4 #include "FairGeoMatrix.h"
5 
6 
8 // FairGeoMatrix
9 //
10 // Simple 3D matrix interface for use with FairGeoVector.
11 //
12 // Note:
13 // This class is completely incomplete. Features will be
14 // added as needed
16 
17 
19  :TObject()
20 {
21  // Initializes the matrix to 0
22  for (int i=0; i<9; i++) { fM[i]=0.0; }
23 }
24 
26 {
27 }
28 
29 Double_t FairGeoMatrix::det(void)
30 {
31  // Computes de determinat of the 3D matrix
32  return (fM[0] * fM[4] * fM[8] + fM[1] * fM[5] * fM[6] + fM[3] *fM[7] * fM[2] -
33  fM[2] * fM[4] * fM[6] - fM[1] * fM[3] * fM[8] - fM[5] *fM[7] * fM[0]);
34 }
35 
37 {
38  // Matrix multiplication
39  FairGeoVector vo;
40  vo.setX(fM[0] * v.getX() + fM[1] * v.getY() + fM[2] * v.getZ());
41  vo.setY(fM[3] * v.getX() + fM[4] * v.getY() + fM[5] * v.getZ());
42  vo.setZ(fM[6] * v.getX() + fM[7] * v.getY() + fM[8] * v.getZ());
43  return vo;
44 }
45 
47 {
48  // Matrix division by a constant. Divides each element on the
49  //matrix by the constant "d"
50  for (int i=0; i<9; i++) { fM[i]/=d; }
51  return *this;
52 }
53