1 #ifndef HGEOMROTATION_H
2 #define HGEOMROTATION_H
6 #include "TRotMatrix.h"
18 inline void setMatrix(
const Double_t*);
19 inline void setMatrix(
const Float_t*);
20 void setEulerAngles(
const Double_t,
const Double_t,
const Double_t);
21 inline void setElement(
const Double_t,
const Int_t);
22 inline Double_t operator () (Int_t)
const;
30 inline Bool_t isUnitMatrix();
33 inline Double_t determinant()
const;
35 inline Double_t getElement(Int_t i,Int_t j)
const;
36 inline void setUnitMatrix();
37 inline void setZero();
38 inline void print()
const;
39 TRotMatrix* createTRotMatrix(
const Text_t* name=
"",
const Text_t* title=
"");
47 rot[0]=rot[4]=rot[8]=1.;
48 rot[1]=rot[2]=rot[3]=rot[5]=rot[6]=rot[7]=0.;
52 if (i>=0 && i<9)
return rot[i];
53 Error(
"operator()",
"bad index");
58 for(Int_t i=0;i<9;i++) rot[i]=a[i];
62 for(Int_t i=0;i<9;i++) rot[i]=a[i];
66 for(Int_t i=0;i<9;i++) rot[i]=a[i];
78 for(Int_t i=0;i<9;i++) rot[i]=r(i);
85 if (rot[i]!=r(i))
return kFALSE;
94 if (rot[i]!=r(i))
return kTRUE;
101 return HGeomVector(rot[0]*v(0)+rot[1]*v(1)+rot[2]*v(2),
102 rot[3]*v(0)+rot[4]*v(1)+rot[5]*v(2),
103 rot[6]*v(0)+rot[7]*v(1)+rot[8]*v(2));
108 for(Int_t i=0;i<9;i++) a[i]=0;
109 for(Int_t i=0;i<3;i++) {
110 for(Int_t j=0;j<3;j++) {
112 for(Int_t k=0;k<3;k++) a[n]+=rot[3*i+k]*r(3*k+j);
119 return *
this=operator * (r);
123 return *
this=r*(*this);
127 return (rot[0]==1. && rot[1]==0. && rot[2]==0. &&
128 rot[3]==0. && rot[4]==1. && rot[5]==0. &&
129 rot[6]==0. && rot[7]==0. && rot[8]==1.) ? kTRUE : kFALSE;
134 for(Int_t i=0;i<3;i++) {
135 for(Int_t j=0;j<3;j++) a[j+3*i]=rot[i+3*j];
141 return *
this=inverse();
145 return rot[0]*(rot[4]*rot[8]-rot[7]*rot[5])
146 -rot[3]*(rot[1]*rot[8]-rot[7]*rot[2])
147 +rot[6]*(rot[1]*rot[5]-rot[4]*rot[2]);
151 rot[0]=rot[4]=rot[8]=1.;
152 rot[1]=rot[2]=rot[3]=rot[5]=rot[6]=rot[7]=0.;
156 for(Int_t i=0;i<9;i++) rot[i]=0.;
160 for(Int_t i=0;i<9;i++) cout<<rot[i]<<
" ";
Double_t getElement(Int_t i, Int_t j) const
Double_t determinant() const
Double_t operator()(Int_t) const
HGeomVector operator*(const HGeomVector &) const
Bool_t operator!=(const HGeomRotation &)
void setMatrix(const Double_t *)
HGeomRotation & transform(const HGeomRotation &)
HGeomRotation inverse() const
Bool_t operator==(const HGeomRotation &)
void setElement(const Double_t, const Int_t)
HGeomRotation & operator*=(const HGeomRotation &)
HGeomRotation & operator=(const HGeomRotation &)