Geant4 Cross Reference |
1 // -*- C++ -*- 1 // -*- C++ -*- >> 2 // $Id:$ 2 // ------------------------------------------- 3 // --------------------------------------------------------------------------- 3 4 4 #include "CLHEP/Geometry/Vector3D.h" 5 #include "CLHEP/Geometry/Vector3D.h" 5 #include "CLHEP/Geometry/Transform3D.h" 6 #include "CLHEP/Geometry/Transform3D.h" 6 7 7 namespace HepGeom { 8 namespace HepGeom { 8 //------------------------------------------ 9 //-------------------------------------------------------------------------- 9 Vector3D<float> & 10 Vector3D<float> & 10 Vector3D<float>::transform(const Transform3D 11 Vector3D<float>::transform(const Transform3D & m) { 11 double vx = x(), vy = y(), vz = z(); 12 double vx = x(), vy = y(), vz = z(); 12 set(m.xx()*vx + m.xy()*vy + m.xz()*vz, 13 set(m.xx()*vx + m.xy()*vy + m.xz()*vz, 13 m.yx()*vx + m.yy()*vy + m.yz()*vz, 14 m.yx()*vx + m.yy()*vy + m.yz()*vz, 14 m.zx()*vx + m.zy()*vy + m.zz()*vz); 15 m.zx()*vx + m.zy()*vy + m.zz()*vz); 15 return *this; 16 return *this; 16 } 17 } 17 18 18 //------------------------------------------ 19 //-------------------------------------------------------------------------- 19 Vector3D<float> 20 Vector3D<float> 20 operator*(const Transform3D & m, const Vecto 21 operator*(const Transform3D & m, const Vector3D<float> & v) { 21 double vx = v.x(), vy = v.y(), vz = v.z(); 22 double vx = v.x(), vy = v.y(), vz = v.z(); 22 return Vector3D<float> 23 return Vector3D<float> 23 (m.xx()*vx + m.xy()*vy + m.xz()*vz, 24 (m.xx()*vx + m.xy()*vy + m.xz()*vz, 24 m.yx()*vx + m.yy()*vy + m.yz()*vz, 25 m.yx()*vx + m.yy()*vy + m.yz()*vz, 25 m.zx()*vx + m.zy()*vy + m.zz()*vz); 26 m.zx()*vx + m.zy()*vy + m.zz()*vz); 26 } 27 } 27 28 28 //------------------------------------------ 29 //-------------------------------------------------------------------------- 29 Vector3D<double> & 30 Vector3D<double> & 30 Vector3D<double>::transform(const Transform3 31 Vector3D<double>::transform(const Transform3D & m) { 31 double vx = x(), vy = y(), vz = z(); 32 double vx = x(), vy = y(), vz = z(); 32 set(m.xx()*vx + m.xy()*vy + m.xz()*vz, 33 set(m.xx()*vx + m.xy()*vy + m.xz()*vz, 33 m.yx()*vx + m.yy()*vy + m.yz()*vz, 34 m.yx()*vx + m.yy()*vy + m.yz()*vz, 34 m.zx()*vx + m.zy()*vy + m.zz()*vz); 35 m.zx()*vx + m.zy()*vy + m.zz()*vz); 35 return *this; 36 return *this; 36 } 37 } 37 38 38 //------------------------------------------ 39 //-------------------------------------------------------------------------- 39 Vector3D<double> 40 Vector3D<double> 40 operator*(const Transform3D & m, const Vecto 41 operator*(const Transform3D & m, const Vector3D<double> & v) { 41 double vx = v.x(), vy = v.y(), vz = v.z(); 42 double vx = v.x(), vy = v.y(), vz = v.z(); 42 return Vector3D<double> 43 return Vector3D<double> 43 (m.xx()*vx + m.xy()*vy + m.xz()*vz, 44 (m.xx()*vx + m.xy()*vy + m.xz()*vz, 44 m.yx()*vx + m.yy()*vy + m.yz()*vz, 45 m.yx()*vx + m.yy()*vy + m.yz()*vz, 45 m.zx()*vx + m.zy()*vy + m.zz()*vz); 46 m.zx()*vx + m.zy()*vy + m.zz()*vz); 46 } 47 } 47 } /* namespace HepGeom */ 48 } /* namespace HepGeom */ 48 49