CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
Geometry
test
testBug6740.cc
Go to the documentation of this file.
1
2
#include <iostream>
3
#include <cmath>
4
#include <float.h>
5
6
#include "
CLHEP/Geometry/Point3D.h
"
7
#include "CLHEP/Vector/ThreeVector.h"
8
9
typedef
HepGeom::Point3D<double>
HepPoint3D
;
10
11
int
main
(
int
,
char
**) {
12
13
CLHEP::Hep3Vector
d(10,0,0);
14
HepPoint3D
a
(0,0,0);
15
HepPoint3D
pv(1,1,1);
16
17
float
expected = 1.41421;
18
int
numbad = 0;
19
20
CLHEP::Hep3Vector
dist = a-pv;
// this does not compile anymore
21
CLHEP::Hep3Vector
Cross = dist.
cross
(d.
unit
());
22
std::cout << Cross.
mag
() << std::endl;
23
24
float
result = Cross.
mag
();
25
float
eps = 1.0e-5;
26
if
( std::fabs(result - expected) > eps ) {
27
++numbad;
28
std::cout <<
"Expected "
<< expected <<
" got "
<< result << std::endl;
29
}
30
return
numbad;
31
32
}
main
int main(int, char **)
Definition:
testBug6740.cc:11
HepPoint3D
HepGeom::Point3D< double > HepPoint3D
Definition:
testBug6740.cc:9
Point3D.h
a
Definition:
testCategories.cc:125
CLHEP::Hep3Vector::unit
Hep3Vector unit() const
CLHEP::Hep3Vector::cross
Hep3Vector cross(const Hep3Vector &) const
CLHEP::Hep3Vector
Definition:
Geometry/CLHEP/Vector/ThreeVector.h:41
CLHEP::Hep3Vector::mag
double mag() const
HepGeom::Point3D< double >
Definition:
CLHEP/Geometry/Point3D.h:123
Generated on Sat Apr 26 2014 20:36:39 for CLHEP by
1.8.6