This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / PHOS / CLHEP / Vector / Rotation.icc
CommitLineData
fe4da5cc 1// -*- C++ -*-
2// $Id$
3// ---------------------------------------------------------------------------
4//
5// This file is a part of the CLHEP - a Class Library for High Energy Physics.
6//
7// This is the definitions of the inline member functions of the
8// HepRotation class
9//
10
11#ifdef HEP_DEBUG_INLINE
12#define inline
13#endif
14
15inline 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) {}
18
19inline 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) {}
22
23inline 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) {}
28
29inline HepDouble HepRotation::xx() const { return rxx; }
30inline HepDouble HepRotation::xy() const { return rxy; }
31inline HepDouble HepRotation::xz() const { return rxz; }
32inline HepDouble HepRotation::yx() const { return ryx; }
33inline HepDouble HepRotation::yy() const { return ryy; }
34inline HepDouble HepRotation::yz() const { return ryz; }
35inline HepDouble HepRotation::zx() const { return rzx; }
36inline HepDouble HepRotation::zy() const { return rzy; }
37inline HepDouble HepRotation::zz() const { return rzz; }
38
39inline HepRotation & HepRotation::operator = (const HepRotation & m) {
40 rxx = m.rxx;
41 rxy = m.rxy;
42 rxz = m.rxz;
43 ryx = m.ryx;
44 ryy = m.ryy;
45 ryz = m.ryz;
46 rzx = m.rzx;
47 rzy = m.rzy;
48 rzz = m.rzz;
49 return *this;
50}
51
52inline 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;
56}
57
58inline 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;
62}
63
64inline 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;
68}
69
70inline 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());
74}
75
76inline HepRotation & HepRotation::operator *= (const HepRotation & m) {
77 return *this = operator * (m);
78}
79
80inline HepRotation & HepRotation::transform(const HepRotation & m) {
81 return *this = m.operator * (*this);
82}
83
84inline HepRotation HepRotation::inverse() const {
85 return HepRotation(rxx, ryx, rzx, rxy, ryy, rzy, rxz, ryz, rzz);
86}
87
88inline HepRotation & HepRotation::invert() {
89 return *this=inverse();
90}
91
92inline HepRotation & HepRotation::rotate(HepDouble psi, const Hep3Vector * p) {
93 return rotate(psi, *p);
94}
95
96#ifdef HEP_DEBUG_INLINE
97#undef inline
98#endif