3 // ---------------------------------------------------------------------------
5 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
7 // This is the definitions of the inline member functions of the
11 #ifdef HEP_DEBUG_INLINE
15 inline HepRotation::HepRotation()
16 : rxx(1.0), rxy(0.0), rxz(0.0), ryx(0.0), ryy(1.0), ryz(0.0),
17 rzx(0.0), rzy(0.0), rzz(1.0) {}
19 inline HepRotation::HepRotation(const HepRotation & m)
20 : rxx(m.rxx), rxy(m.rxy), rxz(m.rxz), ryx(m.ryx), ryy(m.ryy), ryz(m.ryz),
21 rzx(m.rzx), rzy(m.rzy), rzz(m.rzz) {}
23 inline HepRotation::HepRotation(HepDouble mxx, HepDouble mxy, HepDouble mxz,
24 HepDouble myx, HepDouble myy, HepDouble myz,
25 HepDouble mzx, HepDouble mzy, HepDouble mzz)
26 : rxx(mxx), rxy(mxy), rxz(mxz), ryx(myx), ryy(myy), ryz(myz),
27 rzx(mzx), rzy(mzy), rzz(mzz) {}
29 inline HepDouble HepRotation::xx() const { return rxx; }
30 inline HepDouble HepRotation::xy() const { return rxy; }
31 inline HepDouble HepRotation::xz() const { return rxz; }
32 inline HepDouble HepRotation::yx() const { return ryx; }
33 inline HepDouble HepRotation::yy() const { return ryy; }
34 inline HepDouble HepRotation::yz() const { return ryz; }
35 inline HepDouble HepRotation::zx() const { return rzx; }
36 inline HepDouble HepRotation::zy() const { return rzy; }
37 inline HepDouble HepRotation::zz() const { return rzz; }
39 inline HepRotation & HepRotation::operator = (const HepRotation & m) {
52 inline HepBoolean HepRotation::operator == (const HepRotation& m) const {
53 return (rxx == m.rxx && rxy == m.rxy && rxz == m.rxz &&
54 ryx == m.ryx && ryy == m.ryy && ryz == m.ryz &&
55 rzx == m.rzx && rzy == m.rzy && rzz == m.rzz) ? true : false;
58 inline HepBoolean HepRotation::operator != (const HepRotation &m) const {
59 return (rxx != m.rxx || rxy != m.rxy || rxz != m.rxz ||
60 ryx != m.ryx || ryy != m.ryy || ryz != m.ryz ||
61 rzx != m.rzx || rzy != m.rzy || rzz != m.rzz) ? true : false;
64 inline HepBoolean HepRotation::isIdentity() const {
65 return (rxx == 1.0 && rxy == 0.0 && rxz == 0.0 &&
66 ryx == 0.0 && ryy == 1.0 && ryz == 0.0 &&
67 rzx == 0.0 && rzy == 0.0 && rzz == 1.0) ? true : false;
70 inline Hep3Vector HepRotation::operator * (const Hep3Vector & p) const {
71 return Hep3Vector(rxx*p.x() + rxy*p.y() + rxz*p.z(),
72 ryx*p.x() + ryy*p.y() + ryz*p.z(),
73 rzx*p.x() + rzy*p.y() + rzz*p.z());
76 inline HepRotation & HepRotation::operator *= (const HepRotation & m) {
77 return *this = operator * (m);
80 inline HepRotation & HepRotation::transform(const HepRotation & m) {
81 return *this = m.operator * (*this);
84 inline HepRotation HepRotation::inverse() const {
85 return HepRotation(rxx, ryx, rzx, rxy, ryy, rzy, rxz, ryz, rzz);
88 inline HepRotation & HepRotation::invert() {
89 return *this=inverse();
92 inline HepRotation & HepRotation::rotate(HepDouble psi, const Hep3Vector * p) {
93 return rotate(psi, *p);
96 #ifdef HEP_DEBUG_INLINE