4 // ---------------------------------------------------------------------------
7 // This file is a part of the CLHEP - a Class Library for High Energy Physics.
9 // This is the definition of the HepRotation class for performing rotations
10 // on objects of the Hep3Vector class.
13 // ThreeVector.h, LorentzVector.h, LorentzRotation.h
18 #ifndef HEP_ROTATION_H
19 #define HEP_ROTATION_H
25 #include "CLHEP/config/CLHEP.h"
26 #include "CLHEP/Vector/ThreeVector.h"
28 #ifdef HEP_NO_INLINE_IN_DECLARATION
37 // Default constructor. Gives a unit matrix.
39 inline HepRotation(const HepRotation &);
42 inline HepDouble xx() const;
43 inline HepDouble xy() const;
44 inline HepDouble xz() const;
45 inline HepDouble yx() const;
46 inline HepDouble yy() const;
47 inline HepDouble yz() const;
48 inline HepDouble zx() const;
49 inline HepDouble zy() const;
50 inline HepDouble zz() const;
51 // Elements of the rotation matrix (Geant4).
53 HepDouble operator () (int, int) const;
54 // Returns (i,j) element of the rotation matrix.
56 inline HepRotation & operator = (const HepRotation &);
59 inline HepBoolean operator == (const HepRotation &) const;
60 inline HepBoolean operator != (const HepRotation &) const;
61 // Comparisons (Geant4).
63 inline HepBoolean isIdentity() const;
64 // Returns true if the identity matrix (Geant4).
66 inline Hep3Vector operator * (const Hep3Vector &) const;
67 // Multiplication with a Hep3Vector.
69 HepRotation operator * (const HepRotation &) const;
70 inline HepRotation & operator *= (const HepRotation &);
71 inline HepRotation & transform(const HepRotation &);
72 // Matrix multiplication.
73 // Note a *= b; <=> a = a * b; while a.transform(b); <=> a = b * a;
75 inline HepRotation inverse() const;
76 // Returns the inverse.
78 inline HepRotation & invert();
79 // Inverts the Rotation matrix.
81 HepRotation & rotateX(HepDouble);
82 // Rotation around the x-axis.
84 HepRotation & rotateY(HepDouble);
85 // Rotation around the y-axis.
87 HepRotation & rotateZ(HepDouble);
88 // Rotation around the z-axis.
90 HepRotation & rotate(HepDouble, const Hep3Vector &);
91 inline HepRotation & rotate(HepDouble, const Hep3Vector *);
92 // Rotation around a specified vector.
94 HepRotation & rotateAxes(const Hep3Vector & newX,
95 const Hep3Vector & newY,
96 const Hep3Vector & newZ);
97 // Rotation of local axes (Geant4).
99 HepDouble phiX() const;
100 HepDouble phiY() const;
101 HepDouble phiZ() const;
102 HepDouble thetaX() const;
103 HepDouble thetaY() const;
104 HepDouble thetaZ() const;
105 // Return angles (RADS) made by rotated axes against original axes (Geant4).
107 void getAngleAxis(HepDouble &, Hep3Vector &) const;
108 // Returns the rotation angle and rotation axis (Geant4).
112 inline HepRotation(HepDouble, HepDouble, HepDouble, HepDouble, HepDouble,
113 HepDouble, HepDouble, HepDouble, HepDouble);
114 // Protected constructor.
116 HepDouble rxx, rxy, rxz, ryx, ryy, ryz, rzx, rzy, rzz;
117 // The matrix elements.
120 #ifdef HEP_NO_INLINE_IN_DECLARATION
124 #ifdef HEP_SHORT_NAMES
125 typedef HepRotation Rotation;
128 #ifndef HEP_DEBUG_INLINE
129 #include "CLHEP/Vector/Rotation.icc"
132 #endif /* HEP_ROTATION_H */