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"
15inline double HepRotationZ::xx() const { return its_c; }
16inline double HepRotationZ::xy() const { return -its_s; }
17inline double HepRotationZ::yx() const { return its_s; }
18inline double HepRotationZ::yy() const { return its_c; }
20inline double HepRotationZ::zz() const { return 1.0; }
21inline double HepRotationZ::zy() const { return 0.0; }
22inline double HepRotationZ::zx() const { return 0.0; }
23inline double HepRotationZ::yz() const { return 0.0; }
24inline double HepRotationZ::xz() const { return 0.0; }
26inline HepRep3x3 HepRotationZ::rep3x3() const {
27 return HepRep3x3 ( its_c, -its_s, 0.0,
32inline HepRotationZ::HepRotationZ() : its_d(0.0), its_s(0.0), its_c(1.0) {}
34inline HepRotationZ::HepRotationZ(const HepRotationZ & orig) :
35 its_d(orig.its_d), its_s(orig.its_s), its_c(orig.its_c)
38inline HepRotationZ::HepRotationZ(double dd, double ss, double cc) :
39 its_d(dd), its_s(ss), its_c(cc)
42inline HepRotationZ & HepRotationZ::operator= (const HepRotationZ & orig) {
49inline HepRotationZ::~HepRotationZ() {}
51inline Hep3Vector HepRotationZ::colX() const
52 { return Hep3Vector ( its_c, its_s, 0.0 ); }
53inline Hep3Vector HepRotationZ::colY() const
54 { return Hep3Vector ( -its_s, its_c, 0.0 ); }
55inline Hep3Vector HepRotationZ::colZ() const
56 { return Hep3Vector ( 0.0, 0.0, 1.0 ); }
58inline Hep3Vector HepRotationZ::rowX() const
59 { return Hep3Vector ( its_c, -its_s, 0.0 ); }
60inline Hep3Vector HepRotationZ::rowY() const
61 { return Hep3Vector ( its_s, its_c, 0.0 ); }
62inline Hep3Vector HepRotationZ::rowZ() const
63 { return Hep3Vector ( 0.0, 0.0, 1.0 ); }
65inline double HepRotationZ::getPhi () const { return phi(); }
66inline double HepRotationZ::getTheta() const { return theta(); }
67inline double HepRotationZ::getPsi () const { return psi(); }
68inline double HepRotationZ::getDelta() const { return its_d; }
69inline Hep3Vector HepRotationZ::getAxis () const { return axis(); }
71inline double HepRotationZ::delta() const { return its_d; }
72inline Hep3Vector HepRotationZ::axis() const { return Hep3Vector(0,0,1); }
74inline HepAxisAngle HepRotationZ::axisAngle() const {
75 return HepAxisAngle ( axis(), delta() );
78inline void HepRotationZ::getAngleAxis
79 (double & ddelta, Hep3Vector & aaxis) const {
84inline bool HepRotationZ::isIdentity() const {
88inline int HepRotationZ::compare ( const HepRotationZ & r ) const {
89 if (its_d > r.its_d) return 1; else if (its_d < r.its_d) return -1; else return 0;
92inline bool HepRotationZ::operator==(const HepRotationZ & r) const
93 { return (its_d==r.its_d); }
94inline bool HepRotationZ::operator!=(const HepRotationZ & r) const
95 { return (its_d!=r.its_d); }
96inline bool HepRotationZ::operator>=(const HepRotationZ & r) const
97 { return (its_d>=r.its_d); }
98inline bool HepRotationZ::operator<=(const HepRotationZ & r) const
99 { return (its_d<=r.its_d); }
100inline bool HepRotationZ::operator> (const HepRotationZ & r) const
101 { return (its_d> r.its_d); }
102inline bool HepRotationZ::operator< (const HepRotationZ & r) const
103 { return (its_d< r.its_d); }
105inline void HepRotationZ::rectify() {
106 its_d = proper(its_d); // Just in case!
107 its_s = std::sin(its_d);
108 its_c = std::cos(its_d);
111inline Hep3Vector HepRotationZ::operator() (const Hep3Vector & p) const {
115 return Hep3Vector( x * its_c - y * its_s,
116 x * its_s + y * its_c,
120inline Hep3Vector HepRotationZ::operator * (const Hep3Vector & p) const {
121 return operator()(p);
124inline HepLorentzVector HepRotationZ::operator()
125 ( const HepLorentzVector & w ) const {
126 return HepLorentzVector( operator() (w.vect()) , w.t() );
129inline HepLorentzVector HepRotationZ::operator *
130 (const HepLorentzVector & p) const {
131 return operator()(p);
134inline HepRotationZ & HepRotationZ::operator *= (const HepRotationZ & m1) {
135 return *this = (*this) * (m1);
138inline HepRotationZ & HepRotationZ::transform(const HepRotationZ & m1) {
139 return *this = m1 * (*this);
142inline double HepRotationZ::proper( double ddelta ) {
144 if ( std::fabs(ddelta) < CLHEP::pi ) {
147 double x = ddelta / (CLHEP::twopi);
148 return (CLHEP::twopi) * ( x + std::floor(.5-x) );
152inline HepRotationZ HepRotationZ::operator * ( const HepRotationZ & rz ) const {
153 return HepRotationZ ( HepRotationZ::proper(its_d+rz.its_d),
154 its_s*rz.its_c + its_c*rz.its_s,
155 its_c*rz.its_c - its_s*rz.its_s );
158inline HepRotationZ HepRotationZ::inverse() const {
159 return HepRotationZ( proper(-its_d), -its_s, its_c );
162inline HepRotationZ inverseOf(const HepRotationZ & r) {
166inline HepRotationZ & HepRotationZ::invert() {
167 return *this=inverse();
170inline HepLorentzVector HepRotationZ::col1() const
171 { return HepLorentzVector (colX(), 0); }
172inline HepLorentzVector HepRotationZ::col2() const
173 { return HepLorentzVector (colY(), 0); }
174inline HepLorentzVector HepRotationZ::col3() const
175 { return HepLorentzVector (colZ(), 0); }
176inline HepLorentzVector HepRotationZ::col4() const
177 { return HepLorentzVector (0,0,0,1); }
178inline HepLorentzVector HepRotationZ::row1() const
179 { return HepLorentzVector (rowX(), 0); }
180inline HepLorentzVector HepRotationZ::row2() const
181 { return HepLorentzVector (rowY(), 0); }
182inline HepLorentzVector HepRotationZ::row3() const
183 { return HepLorentzVector (rowZ(), 0); }
184inline HepLorentzVector HepRotationZ::row4() const
185 { return HepLorentzVector (0,0,0,1); }
186inline double HepRotationZ::xt() const { return 0.0; }
187inline double HepRotationZ::yt() const { return 0.0; }
188inline double HepRotationZ::zt() const { return 0.0; }
189inline double HepRotationZ::tx() const { return 0.0; }
190inline double HepRotationZ::ty() const { return 0.0; }
191inline double HepRotationZ::tz() const { return 0.0; }
192inline double HepRotationZ::tt() const { return 1.0; }
194inline HepRep4x4 HepRotationZ::rep4x4() const {
195 return HepRep4x4 ( its_c, -its_s, 0.0, 0.0,
196 its_s, its_c, 0.0, 0.0,
198 0.0, 0.0, 0.0, 1.0 );
201inline double HepRotationZ::getTolerance() {
202 return Hep4RotationInterface::tolerance;
204inline double HepRotationZ::setTolerance(double tol) {
205 return Hep4RotationInterface::setTolerance(tol);