Jpp  18.1.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JRotator3D.hh
Go to the documentation of this file.
1 #ifndef __JROTATOR3D__
2 #define __JROTATOR3D__
3 
4 #include <vector>
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  * Type definition of rotation set.
22  */
24 
25 
26  /**
27  * Rotation set.
28  */
29  class JRotator3D :
30  public JRotator3D_t
31  {
32  public:
33  /**
34  * Default constructor.
35  */
37  JRotator3D_t()
38  {}
39 
40 
41  /**
42  * Constructor.
43  *
44  * Any sequence of <tt><= n</tt> rotations is equivalent to a single rotation corresponding
45  * to the nth input direction (i.e.\ <tt>X.rotate(JRotation3D(omega[n])))</tt>.\n
46  * A final rotation is added to restore the original coordinate system.
47  *
48  * \param omega direction set
49  */
50  JRotator3D(const JOmega3D_t& omega) :
51  JRotator3D_t()
52  {
53  if (!omega.empty()) {
54 
55  JOmega3D_t::const_iterator dir = omega.begin();
56 
57  JRotation3D R(*dir);
58 
59  push_back(R);
60 
61  while (++dir != omega.end()) {
62 
63  JRotation3D r(*dir);
64 
65  push_back(r.mul(R.transpose()));
66 
67  R = JRotation3D(*dir);
68  }
69 
70  push_back(R.transpose());
71  }
72  }
73  };
74 }
75 
76 #endif
JRotation3D & transpose()
Transpose.
Definition: JRotation3D.hh:305
Rotation matrix.
Definition: JRotation3D.hh:111
data_type r[M+1]
Definition: JPolint.hh:779
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
JRotator3D(const JOmega3D_t &omega)
Constructor.
Definition: JRotator3D.hh:50
std::vector< JRotation3D > JRotator3D_t
Type definition of rotation set.
Definition: JRotator3D.hh:23
Rotation set.
Definition: JRotator3D.hh:29
JRotation3D & mul(const JRotation3D &A, const JRotation3D &B)
Matrix multiplication.
Definition: JRotation3D.hh:320
Base class for direction set.
Definition: JOmega3D.hh:29
JRotator3D()
Default constructor.
Definition: JRotator3D.hh:36