Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JCompassMatrix.hh
Go to the documentation of this file.
1 #ifndef __JDETECTOR__JCOMPASSMATRIX__
2 #define __JDETECTOR__JCOMPASSMATRIX__
3 
4 #include <cmath>
5 
7 #include "JDetector/JCompass.hh"
8 
9 
10 /**
11  * \author mdejong
12  */
13 
14 namespace JDETECTOR {}
15 namespace JPP { using namespace JDETECTOR; }
16 
17 namespace JDETECTOR {
18 
20 
21 
22  /**
23  * Compass matrix
24  *
25  * The Compass matrix is a genuine 3D rotation matrix, i.e.
26  * the inverse of a Compass matrix is equal to its tranpose.
27  *
28  * The Compass angles are defined as follows:
29  *
30  * -# pitch 2D rotation around X -axis;
31  * -# roll 2D rotation around Y' -axis;
32  * -# yaw 2D rotation around Z''-axis;
33  */
35  public JRotation3D
36  {
37  public:
38  /**
39  * Default constructor (= identity matrix).
40  */
42  JRotation3D()
43  {}
44 
45 
46  /**
47  * Constructor.
48  *
49  * \param compass compass
50  */
51  JCompassMatrix(const JCompass& compass) :
52  JRotation3D()
53  {
54  using namespace JGEOMETRY3D;
55 
56  const JRotation3D Rx = JRotation3X(compass.getPitch());
57  const JRotation3D Ry = JRotation3Y(compass.getRoll());
58  const JRotation3D Rz = JRotation3Z(compass.getYaw());
59 
60  set(Rz * Ry * Rx);
61  }
62  };
63 }
64 
65 #endif
Rotation matrix.
Definition: JRotation3D.hh:108
Rotation around Z-axis.
Definition: JRotation3D.hh:82
double getRoll() const
Get roll compass.
Definition: JCompass.hh:178
JCompassMatrix(const JCompass &compass)
Constructor.
double getYaw() const
Get yaw compass.
Definition: JCompass.hh:189
JCompassMatrix()
Default constructor (= identity matrix).
Data structure for comapss in three dimensions.
Definition: JCompass.hh:31
Rotation around Y-axis.
Definition: JRotation3D.hh:54
Rotation around X-axis.
Definition: JRotation3D.hh:28
double getPitch() const
Get pitch compass.
Definition: JCompass.hh:167
void set(const JMatrix3D &A)
Set matrix.