14#include "CLHEP/Vector/defs.h"
15#include "CLHEP/Vector/AxisAngle.h"
16#include "CLHEP/Vector/ThreeVector.h"
25static void ZMpvAxisAngleRep(
const HepAxisAngle & aa,
double array[] ) {
27 double sinDelta = std::sin( aa.delta() );
28 double cosDelta = std::cos( aa.delta() );
29 double oneMinusCosDelta = 1.0 - cosDelta;
31 double uX = aa.getAxis().getX();
32 double uY = aa.getAxis().getY();
33 double uZ = aa.getAxis().getZ();
35 array[0] = oneMinusCosDelta * uX * uX + cosDelta;
36 array[1] = oneMinusCosDelta * uX * uY - sinDelta * uZ;
37 array[2] = oneMinusCosDelta * uX * uZ + sinDelta * uY;
39 array[3] = oneMinusCosDelta * uY * uX + sinDelta * uZ;
40 array[4] = oneMinusCosDelta * uY * uY + cosDelta;
41 array[5] = oneMinusCosDelta * uY * uZ - sinDelta * uX;
43 array[6] = oneMinusCosDelta * uZ * uX - sinDelta * uY;
44 array[7] = oneMinusCosDelta * uZ * uY + sinDelta * uX;
45 array[8] = oneMinusCosDelta * uZ * uZ + cosDelta;
55 ZMpvAxisAngleRep( *
this, thisRep );
56 ZMpvAxisAngleRep( aa, aaRep );
59 for (
int i = 0; i < 9; i++ ) {
60 sum += thisRep[i] * aaRep[i];
64 return (d >= 0) ? d : 0;
71 return distance( aa ) <= epsilon * epsilon;
91 os <<
'(' << aa.
axis() <<
", " << aa.
delta() <<
')';
97 double & x,
double & y,
double & z,
106 aa.
set ( axis, delta );
static const int ToleranceTicks
void set(double x, double y, double z)
bool isNear(const AA &aa, Scalar epsilon=tolerance) const
double distance(const HepAxisAngle &aa) const
double howNear(const AA &aa) const
AA & set(const Hep3Vector axis, Scalar delta)
std::istream & operator>>(std::istream &is, HepRandom &dist)
std::ostream & operator<<(std::ostream &s, const HepDiagMatrix &q)
void ZMinputAxisAngle(std::istream &is, double &x, double &y, double &z, double &delta)