10#include "CLHEP/Vector/defs.h"
11#include "CLHEP/Vector/RotationZ.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(dddelta)), its_s(std::sin(dddelta)), its_c(std::cos(dddelta))
64 return (
yx() == 0.0 &&
xx() == 0.0) ? 0.0 : std::atan2(
yx(),
xx());
69 return (
yy() == 0.0 &&
xy() == 0.0) ? 0.0 : std::atan2(
yy(),
xy());
73 return (
yz() == 0.0 &&
xz() == 0.0) ? 0.0 : std::atan2(
yz(),
xz());
78 return safe_acos(
zx());
83 return safe_acos(
zy());
88 return safe_acos(
zz());
122 return (answer >= 0) ? answer : 0;
126 double sum =
xx() * r.
xx() +
xy() * r.
xy()
129 double answer = 3.0 - sum;
130 return (answer >= 0 ) ? answer : 0;
137 double bet = b.
beta();
138 double bet2 = bet*bet;
160 return (
distance2(r) <= epsilon*epsilon);
163 return (
distance2(r) <= epsilon*epsilon);
166 return (
distance2(lt) <= epsilon*epsilon);
169 double epsilon)
const {
170 return (
distance2(lt) <= epsilon*epsilon);
174 return 2.0 - 2.0 *
its_c;
178 os <<
"\nRotation about Z (" <<
its_d <<
179 ") [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
double distance2(const HepRotationZ &r) const
HepAxisAngle axisAngle() const
bool isNear(const HepRotationZ &r, double epsilon=Hep4RotationInterface::tolerance) const
static double proper(double delta)
HepRotationZ & set(double delta)
void setDelta(double delta)
void decompose(HepAxisAngle &rotation, Hep3Vector &boost) const
HepEulerAngles eulerAngles() const
std::ostream & print(std::ostream &os) const
double howNear(const HepRotationZ &r) const