GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
CartesianCoordinateSystem.cc
1 #include "gearsurf/CartesianCoordinateSystem.h"
2 
3 namespace gear{
4 
5  CLHEP::Hep3Vector CartesianCoordinateSystem::getLocalPoint( CLHEP::Hep3Vector globalPoint ) const {
6 
7  // First we get us a new origin via translation
8  CLHEP::Hep3Vector x = globalPoint - _T;
9 
10  // Then we do the rotation
11  return _R_inv*x;
12 
13  }
14 
15  CLHEP::Hep3Vector CartesianCoordinateSystem::getGlobalPoint( CLHEP::Hep3Vector localPoint ) const {
16 
17 
18  // The point in global coordinates is the place of the origin in gloabl coordinates (=T) plus
19  // the local coordinates rotated into the global ones
20  return _T + _R*localPoint;
21 
22  }
23 
24 } //end of gear namespace
25 
26 
27 
virtual CLHEP::Hep3Vector getGlobalPoint(CLHEP::Hep3Vector localPoint) const
virtual CLHEP::Hep3Vector getLocalPoint(CLHEP::Hep3Vector globalPoint) const