14#include "CLHEP/Vector/defs.h"
15#include "CLHEP/Vector/RotationY.h"
16#include "CLHEP/Vector/AxisAngle.h"
17#include "CLHEP/Vector/EulerAngles.h"
18#include "CLHEP/Vector/LorentzRotation.h"
19#include "CLHEP/Units/PhysicalConstants.h"
27static inline double safe_acos (
double x) {
28 if (std::abs(x) <= 1.0)
return std::acos(x);
29 return ( (x>0) ? 0 : CLHEP::pi );
33 its_d(proper(ddelta)), its_s(std::sin(ddelta)), its_c(std::cos(ddelta))
46 }
else if ( (
its_d < 0) || (
its_d == CLHEP::pi) ) {
47 return +CLHEP::halfpi;
49 return -CLHEP::halfpi;
54 return std::fabs(
its_d );
60 }
else if ( (
its_d < 0) || (
its_d == CLHEP::pi) ) {
61 return -CLHEP::halfpi;
63 return +CLHEP::halfpi;
80 return (
yx() == 0.0 &&
xx() == 0.0) ? 0.0 : std::atan2(
yx(),
xx());
85 return (
yy() == 0.0 &&
xy() == 0.0) ? 0.0 : std::atan2(
yy(),
xy());
90 return (
yz() == 0.0 &&
xz() == 0.0) ? 0.0 : std::atan2(
yz(),
xz());
95 return safe_acos(
zx());
99 return safe_acos(
zy());
104 return safe_acos(
zz());
138 return (answer >= 0) ? answer : 0;
142 double sum =
xx() * r.
xx() +
xz() * r.
xz()
145 double answer = 3.0 - sum;
146 return (answer >= 0 ) ? answer : 0;
153 double bet =
b.beta();
154 double bet2 = bet*bet;
176 return (
distance2(r) <= epsilon*epsilon);
179 return (
distance2(r) <= epsilon*epsilon);
182 return (
distance2(lt) <= epsilon*epsilon);
185 double epsilon)
const {
186 return (
distance2(lt) <= epsilon*epsilon);
190 return 2.0 - 2.0 *
its_c;
194 os <<
"\nRotation about Y (" <<
its_d <<
195 ") [cos d = " <<
its_c <<
" sin d = " <<
its_s <<
"]\n";
void set(double x, double y, double z)
HepBoost & set(double betaX, double betaY, double betaZ)
void decompose(Hep3Vector &boost, HepAxisAngle &rotation) const
void setDelta(double delta)
static double proper(double delta)
bool isNear(const HepRotationY &r, double epsilon=Hep4RotationInterface::tolerance) const
double howNear(const HepRotationY &r) const
void decompose(HepAxisAngle &rotation, Hep3Vector &boost) const
HepRotationY & set(double delta)
HepAxisAngle axisAngle() const
double distance2(const HepRotationY &r) const
std::ostream & print(std::ostream &os) const
HepEulerAngles eulerAngles() const