2 // ---------------------------------------------------------------------------
4 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
6 // This is the definitions of the inline member functions of the
11 #include "CLHEP/Units/PhysicalConstants.h"
15 inline double HepRotationY::xx() const { return its_c; }
16 inline double HepRotationY::xz() const { return its_s; }
17 inline double HepRotationY::zx() const { return -its_s; }
18 inline double HepRotationY::zz() const { return its_c; }
20 inline double HepRotationY::yy() const { return 1.0; }
21 inline double HepRotationY::yx() const { return 0.0; }
22 inline double HepRotationY::yz() const { return 0.0; }
23 inline double HepRotationY::xy() const { return 0.0; }
24 inline double HepRotationY::zy() const { return 0.0; }
26 inline HepRep3x3 HepRotationY::rep3x3() const {
27 return HepRep3x3 ( its_c, 0.0, its_s,
32 inline HepRotationY::HepRotationY() : its_d(0.0), its_s(0.0), its_c(1.0) {}
34 inline HepRotationY::HepRotationY(const HepRotationY & orig) :
35 its_d(orig.its_d), its_s(orig.its_s), its_c(orig.its_c)
38 inline HepRotationY::HepRotationY(double dd, double ss, double cc) :
39 its_d(dd), its_s(ss), its_c(cc)
42 inline HepRotationY & HepRotationY::operator= (const HepRotationY & orig) {
49 inline HepRotationY::~HepRotationY() {}
51 inline Hep3Vector HepRotationY::colX() const
52 { return Hep3Vector ( its_c, 0.0, -its_s ); }
53 inline Hep3Vector HepRotationY::colY() const
54 { return Hep3Vector ( 0.0, 1.0, 0.0 ); }
55 inline Hep3Vector HepRotationY::colZ() const
56 { return Hep3Vector ( its_s, 0.0, its_c ); }
58 inline Hep3Vector HepRotationY::rowX() const
59 { return Hep3Vector ( its_c, 0.0, its_s ); }
60 inline Hep3Vector HepRotationY::rowY() const
61 { return Hep3Vector ( 0.0, 1.0, 0.0 ); }
62 inline Hep3Vector HepRotationY::rowZ() const
63 { return Hep3Vector ( -its_s, 0.0, its_c ); }
65 inline double HepRotationY::getPhi () const { return phi(); }
66 inline double HepRotationY::getTheta() const { return theta(); }
67 inline double HepRotationY::getPsi () const { return psi(); }
68 inline double HepRotationY::getDelta() const { return its_d; }
69 inline Hep3Vector HepRotationY::getAxis () const { return axis(); }
71 inline double HepRotationY::delta() const { return its_d; }
72 inline Hep3Vector HepRotationY::axis() const { return Hep3Vector(0,1,0); }
74 inline HepAxisAngle HepRotationY::axisAngle() const {
75 return HepAxisAngle ( axis(), delta() );
78 inline void HepRotationY::getAngleAxis
79 (double & ddelta, Hep3Vector & aaxis) const {
84 inline bool HepRotationY::isIdentity() const {
88 inline int HepRotationY::compare ( const HepRotationY & r ) const {
89 if (its_d > r.its_d) return 1; else if (its_d < r.its_d) return -1; else return 0;
93 inline bool HepRotationY::operator==(const HepRotationY & r) const
94 { return (its_d==r.its_d); }
95 inline bool HepRotationY::operator!=(const HepRotationY & r) const
96 { return (its_d!=r.its_d); }
97 inline bool HepRotationY::operator>=(const HepRotationY & r) const
98 { return (its_d>=r.its_d); }
99 inline bool HepRotationY::operator<=(const HepRotationY & r) const
100 { return (its_d<=r.its_d); }
101 inline bool HepRotationY::operator> (const HepRotationY & r) const
102 { return (its_d> r.its_d); }
103 inline bool HepRotationY::operator< (const HepRotationY & r) const
104 { return (its_d< r.its_d); }
106 inline void HepRotationY::rectify() {
107 its_d = proper(its_d); // Just in case!
108 its_s = std::sin(its_d);
109 its_c = std::cos(its_d);
112 inline Hep3Vector HepRotationY::operator() (const Hep3Vector & p) const {
116 return Hep3Vector( x * its_c + z * its_s,
118 z * its_c - x * its_s );
121 inline Hep3Vector HepRotationY::operator * (const Hep3Vector & p) const {
122 return operator()(p);
125 inline HepLorentzVector HepRotationY::operator()
126 ( const HepLorentzVector & w ) const {
127 return HepLorentzVector( operator() (w.vect()) , w.t() );
130 inline HepLorentzVector HepRotationY::operator *
131 (const HepLorentzVector & p) const {
132 return operator()(p);
135 inline HepRotationY & HepRotationY::operator *= (const HepRotationY & m1) {
136 return *this = (*this) * (m1);
139 inline HepRotationY & HepRotationY::transform(const HepRotationY & m1) {
140 return *this = m1 * (*this);
143 inline double HepRotationY::proper( double ddelta ) {
145 if ( std::fabs(ddelta) < CLHEP::pi ) {
148 register double x = ddelta / (CLHEP::twopi);
149 return (CLHEP::twopi) * ( x + std::floor(.5-x) );
153 inline HepRotationY HepRotationY::operator * ( const HepRotationY & ry ) const {
154 return HepRotationY ( HepRotationY::proper(its_d+ry.its_d),
155 its_s*ry.its_c + its_c*ry.its_s,
156 its_c*ry.its_c - its_s*ry.its_s );
159 inline HepRotationY HepRotationY::inverse() const {
160 return HepRotationY( proper(-its_d), -its_s, its_c );
163 inline HepRotationY inverseOf(const HepRotationY & r) {
167 inline HepRotationY & HepRotationY::invert() {
168 return *this=inverse();
171 inline HepLorentzVector HepRotationY::col1() const
172 { return HepLorentzVector (colX(), 0); }
173 inline HepLorentzVector HepRotationY::col2() const
174 { return HepLorentzVector (colY(), 0); }
175 inline HepLorentzVector HepRotationY::col3() const
176 { return HepLorentzVector (colZ(), 0); }
177 inline HepLorentzVector HepRotationY::col4() const
178 { return HepLorentzVector (0,0,0,1); }
179 inline HepLorentzVector HepRotationY::row1() const
180 { return HepLorentzVector (rowX(), 0); }
181 inline HepLorentzVector HepRotationY::row2() const
182 { return HepLorentzVector (rowY(), 0); }
183 inline HepLorentzVector HepRotationY::row3() const
184 { return HepLorentzVector (rowZ(), 0); }
185 inline HepLorentzVector HepRotationY::row4() const
186 { return HepLorentzVector (0,0,0,1); }
187 inline double HepRotationY::xt() const { return 0.0; }
188 inline double HepRotationY::yt() const { return 0.0; }
189 inline double HepRotationY::zt() const { return 0.0; }
190 inline double HepRotationY::tx() const { return 0.0; }
191 inline double HepRotationY::ty() const { return 0.0; }
192 inline double HepRotationY::tz() const { return 0.0; }
193 inline double HepRotationY::tt() const { return 1.0; }
195 inline HepRep4x4 HepRotationY::rep4x4() const {
196 return HepRep4x4 ( its_c, 0.0, its_s, 0.0,
198 -its_s, 0.0, its_c, 0.0,
199 0.0, 0.0, 0.0, 1.0 );
202 inline double HepRotationY::getTolerance() {
203 return Hep4RotationInterface::tolerance;
205 inline double HepRotationY::setTolerance(double tol) {
206 return Hep4RotationInterface::setTolerance(tol);