Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JTransformation3D.hh
Go to the documentation of this file.
1#ifndef __JTRANSFORMATION3D__
2#define __JTRANSFORMATION3D__
3
7
8
9/**
10 * \author mdejong
11 */
12
13namespace JGEOMETRY3D {}
14namespace JPP { using namespace JGEOMETRY3D; }
15
16namespace JGEOMETRY3D {
17
18 /**
19 * Transformation.
20 *
21 * This class defines the transformation of the coordinate system such that
22 * the z-axis is along the given direction with the origin at the given position.
23 */
25 public JPosition3D,
26 public JRotation3D
27 {
28 /**
29 * Constructor.
30 *
31 * \param pos position
32 * \param dir direction
33 */
35 const JDirection3D& dir) :
36 JPosition3D(pos),
37 JRotation3D(dir)
38 {
39 this->getPosition().rotate(this->getRotation());
40 }
41
42
43 /**
44 * Transform position.
45 *
46 * \param pos position
47 * \return position
48 */
50 {
51 JPosition3D abc(pos);
52
53 abc.transform(this->getRotation(), this->getPosition());
54
55 return abc;
56 }
57
58
59 /**
60 * Transform back position.
61 *
62 * \param pos position
63 * \return position
64 */
66 {
67 JPosition3D abc(pos);
68
69 abc.transform_back(this->getRotation(), this->getPosition());
70
71 return abc;
72 }
73 };
74}
75
76#endif
Data structure for direction in three dimensions.
Data structure for position in three dimensions.
void transform_back(const JRotation3D &R, const JVector3D &pos)
Transform back position.
void transform(const JRotation3D &R, const JVector3D &pos)
Transform position.
JPosition3D & rotate(const JRotation3D &R)
Rotate.
const JPosition3D & getPosition() const
Get position.
const JRotation3D & getRotation() const
Get rotation.
Auxiliary classes and methods for 3D geometrical objects and operations.
Definition JAngle3D.hh:19
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JTransformation3D(const JPosition3D &pos, const JDirection3D &dir)
Constructor.
JPosition3D transform(const JPosition3D &pos) const
Transform position.
JPosition3D transform_back(const JPosition3D &pos) const
Transform back position.