GeoModel - GeoModelCore
GeoDefinitions.cxx
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "GeoModelKernel/GeoDefinitions.h"
6 
7 namespace GeoTrf
8 {
9  GeoRotation::GeoRotation(double phi, double theta, double psi)
10  {
11  double sinPhi = std::sin( phi ), cosPhi = std::cos( phi );
12  double sinTheta = std::sin( theta ), cosTheta = std::cos( theta );
13  double sinPsi = std::sin( psi ), cosPsi = std::cos( psi );
14 
15  this->operator()(0,0) = cosPsi * cosPhi - cosTheta * sinPhi * sinPsi;
16  this->operator()(0,1) = cosPsi * sinPhi + cosTheta * cosPhi * sinPsi;
17  this->operator()(0,2) = sinPsi * sinTheta;
18 
19  this->operator()(1,0) = - sinPsi * cosPhi - cosTheta * sinPhi * cosPsi;
20  this->operator()(1,1) = - sinPsi * sinPhi + cosTheta * cosPhi * cosPsi;
21  this->operator()(1,2) = cosPsi * sinTheta;
22 
23  this->operator()(2,0) = sinTheta * sinPhi;
24  this->operator()(2,1) = - sinTheta * cosPhi;
25  this->operator()(2,2) = cosTheta;
26  }
27 }
28