CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 00002 #include <iostream> 00003 #include <cmath> 00004 #include <float.h> 00005 00006 #include "CLHEP/Geometry/Point3D.h" 00007 #include "CLHEP/Vector/ThreeVector.h" 00008 00009 typedef HepGeom::Point3D<double> HepPoint3D; 00010 00011 int main(int, char **) { 00012 00013 CLHEP::Hep3Vector d(10,0,0); 00014 HepPoint3D a(0,0,0); 00015 HepPoint3D pv(1,1,1); 00016 00017 float expected = 1.41421; 00018 int numbad = 0; 00019 00020 CLHEP::Hep3Vector dist = a-pv; // this does not compile anymore 00021 CLHEP::Hep3Vector Cross = dist.cross(d.unit()); 00022 std::cout << Cross.mag() << std::endl; 00023 00024 float result = Cross.mag(); 00025 float eps = 1.0e-5; 00026 if( std::fabs(result - expected) > eps ) { 00027 ++numbad; 00028 std::cout << "Expected " << expected << " got " << result << std::endl; 00029 } 00030 return numbad; 00031 00032 }