Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
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
14namespace JGEOMETRY3D {}
15namespace JPP { using namespace JGEOMETRY3D; }
16
17namespace 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 */
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) :
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
JRotator3D(const JOmega3D_t &omega)
Constructor.
Definition JRotator3D.hh:50
JRotator3D()
Default constructor.
Definition JRotator3D.hh:36
Auxiliary classes and methods for 3D geometrical objects and operations.
Definition JAngle3D.hh:19
std::vector< JRotation3D > JRotator3D_t
Type definition of rotation set.
Definition JRotator3D.hh:23
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Base class for direction set.
Definition JOmega3D.hh:31