Jpp  18.3.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JEulerMatrix3D.hh
Go to the documentation of this file.
1 #ifndef __JEULERMATRIX3D__
2 #define __JEULERMATRIX3D__
3 
4 #include <cmath>
5 
8 
9 
10 /**
11  * \author mdejong
12  */
13 
14 namespace JGEOMETRY3D {}
15 namespace JPP { using namespace JGEOMETRY3D; }
16 
17 namespace JGEOMETRY3D {
18 
19 
20  /**
21  * Euler matrix
22  *
23  * The Euler matrix is a genuine 3D rotation matrix, i.e.
24  * the inverse of an Euler matrix is equal to its tranpose.
25  *
26  * The Euler angles are defined as follows:
27  *
28  * -# alpha 2D rotation around Z -axis;
29  * -# beta 2D rotation around X' -axis;
30  * -# gamma 2D rotation around Z''-axis;
31  */
33  public JRotation3D
34  {
35  public:
36  /**
37  * Default constructor (= identity matrix).
38  */
40  JRotation3D()
41  {}
42 
43 
44  /**
45  * Constructor.
46  *
47  * \param euler Euler angles
48  */
49  JEulerMatrix3D(const JEulerAngle3D& euler) :
50  JRotation3D()
51  {
52  const double ca = cos(euler.getAlpha());
53  const double sa = sin(euler.getAlpha());
54  const double cb = cos(euler.getBeta());
55  const double sb = sin(euler.getBeta());
56  const double cg = cos(euler.getGamma());
57  const double sg = sin(euler.getGamma());
58 
59  a00 = cg*ca - sg*cb*sa; a01 = -cg*sa - sg*cb*ca; a02 = sg*sb;
60  a10 = sg*ca + cg*cb*sa; a11 = -sg*sa + cg*cb*ca; a12 = -cg*sb;
61  a20 = sb*sa; a21 = sb*ca; a22 = cb;
62  }
63  };
64 }
65 
66 #endif
Data structure for Euler angles in three dimensions.
double getGamma() const
Get gamma angle.
Rotation matrix.
Definition: JRotation3D.hh:111
JEulerMatrix3D()
Default constructor (= identity matrix).
then usage set_variable ACOUSTICS_WORKDIR $WORKDIR set_variable FORMULA sin([0]+2 *$PI *([1]+[2]*x)*x)" set_variable DY 1.0e-8 mkdir $WORKDIR for DETECTOR in $DETECTORS[*]
double getAlpha() const
Get alpha angle.
double getBeta() const
Get beta angle.
JEulerMatrix3D(const JEulerAngle3D &euler)
Constructor.