10#include "CLHEP/Vector/defs.h"
11#include "CLHEP/Vector/RotationY.h"
12#include "CLHEP/Vector/AxisAngle.h"
13#include "CLHEP/Vector/EulerAngles.h"
14#include "CLHEP/Vector/LorentzRotation.h"
15#include "CLHEP/Units/PhysicalConstants.h"
23static inline double safe_acos (
double x) {
24 if (std::abs(x) <= 1.0)
return std::acos(x);
25 return ( (x>0) ? 0 : CLHEP::pi );
29 its_d(proper(ddelta)), its_s(std::sin(ddelta)), its_c(std::cos(ddelta))
42 }
else if ( (
its_d < 0) || (
its_d == CLHEP::pi) ) {
43 return +CLHEP::halfpi;
45 return -CLHEP::halfpi;
50 return std::fabs(
its_d );
56 }
else if ( (
its_d < 0) || (
its_d == CLHEP::pi) ) {
57 return -CLHEP::halfpi;
59 return +CLHEP::halfpi;
76 return (
yx() == 0.0 &&
xx() == 0.0) ? 0.0 : std::atan2(
yx(),
xx());
81 return (
yy() == 0.0 &&
xy() == 0.0) ? 0.0 : std::atan2(
yy(),
xy());
86 return (
yz() == 0.0 &&
xz() == 0.0) ? 0.0 : std::atan2(
yz(),
xz());
91 return safe_acos(
zx());
95 return safe_acos(
zy());
100 return safe_acos(
zz());
134 return (answer >= 0) ? answer : 0;
138 double sum =
xx() * r.
xx() +
xz() * r.
xz()
141 double answer = 3.0 - sum;
142 return (answer >= 0 ) ? answer : 0;
149 double bet = b.
beta();
150 double bet2 = bet*bet;
172 return (
distance2(r) <= epsilon*epsilon);
175 return (
distance2(r) <= epsilon*epsilon);
178 return (
distance2(lt) <= epsilon*epsilon);
181 double epsilon)
const {
182 return (
distance2(lt) <= epsilon*epsilon);
186 return 2.0 - 2.0 *
its_c;
190 os <<
"\nRotation about Y (" <<
its_d <<
191 ") [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