24 #include "CLHEP/Vector/EulerAngles.h"
26 #include "CLHEP/Vector/ThreeVector.h"
45 double sinPhi = std::sin( ex.phi() ) , cosPhi = std::cos( ex.phi() );
46 double sinTheta = std::sin( ex.theta() ), cosTheta = std::cos( ex.theta() );
47 double sinPsi = std::sin( ex.psi() ) , cosPsi = std::cos( ex.psi() );
49 array[0] = cosPsi * cosPhi - sinPsi * cosTheta * sinPhi;
50 array[1] = cosPsi * sinPhi + sinPsi * cosTheta * cosPhi;
51 array[2] = sinPsi * sinTheta;
53 array[3] = - sinPsi * cosPhi - cosPsi * cosTheta * sinPhi;
54 array[4] = - sinPsi * sinPhi + cosPsi * cosTheta * cosPhi;
55 array[5] = cosPsi * sinTheta;
57 array[6] = sinTheta * sinPhi;
58 array[7] = - sinTheta * cosPhi;
64 double HepEulerAngles::distance(
const EA & ex )
const {
73 for (
int i = 0; i < 9; i++) {
74 sum += thisRep[i] * exRep[i];
78 return (d >= 0) ? d : 0;
83 bool HepEulerAngles::isNear(
const EA & ex,
double epsilon )
const {
85 return distance( ex ) <= epsilon*epsilon ;
90 double HepEulerAngles::howNear(
const EA & ex )
const {
92 return std::sqrt( distance( ex ) );
100 std::ostream &
operator<<(std::ostream & os,
const HepEulerAngles & ea)
102 os <<
"(" << ea.phi() <<
", " << ea.theta() <<
", " << ea.psi() <<
")";
107 double & x,
double & y,
double &
z );
109 std::istream &
operator>>(std::istream & is, HepEulerAngles & ea) {
114 ea.set ( thePhi , theTheta , thePsi );
static const G4double tolerance
std::istream & operator>>(std::istream &is, HepAxisAngle &aa)
static void ZMpvEulerAnglesRep(const HepEulerAngles &ex, double array[])
std::ostream & operator<<(std::ostream &os, const HepAxisAngle &aa)
void ZMinput3doubles(std::istream &is, const char *type, double &x, double &y, double &z)