OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
src
src
Classic
Algorithms
CoordinateSystemTrafo.cpp
Go to the documentation of this file.
1
#include "
Algorithms/CoordinateSystemTrafo.h
"
2
#include "
Utility/Inform.h
"
3
4
extern
Inform
*
gmsg
;
5
6
CoordinateSystemTrafo::CoordinateSystemTrafo
():
7
origin_m(0.0),
8
orientation_m(1.0, 0.0, 0.0, 0.0),
9
rotationMatrix_m(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0)
10
{ }
11
12
CoordinateSystemTrafo::CoordinateSystemTrafo
(
const
CoordinateSystemTrafo
&right):
13
origin_m(right.origin_m),
14
orientation_m(right.orientation_m),
15
rotationMatrix_m(right.rotationMatrix_m)
16
{ }
17
18
CoordinateSystemTrafo::CoordinateSystemTrafo
(
const
Vector_t
&origin,
19
const
Quaternion
&orientation):
20
origin_m(origin),
21
orientation_m(orientation),
22
rotationMatrix_m(orientation_m.getRotationMatrix())
23
{ }
24
25
void
CoordinateSystemTrafo::invert
() {
26
origin_m
= -
orientation_m
.
rotate
(
origin_m
);
27
orientation_m
=
orientation_m
.
conjugate
();
28
rotationMatrix_m
=
transpose
(
rotationMatrix_m
);
29
}
30
31
CoordinateSystemTrafo
CoordinateSystemTrafo::operator*
(
const
CoordinateSystemTrafo
&right)
const
{
32
CoordinateSystemTrafo
result(*
this
);
33
34
result *= right;
35
return
result;
36
}
37
38
void
CoordinateSystemTrafo::operator*=
(
const
CoordinateSystemTrafo
&right) {
39
origin_m
= right.
orientation_m
.
conjugate
().
rotate
(
origin_m
) + right.
origin_m
;
40
orientation_m
*= right.
orientation_m
;
41
orientation_m
.
normalize
();
42
rotationMatrix_m
=
orientation_m
.
getRotationMatrix
();
43
}
gmsg
Inform * gmsg
Definition:
Main.cpp:62
CoordinateSystemTrafo.h
transpose
AntiSymTenzor< T, D > transpose(const AntiSymTenzor< T, D > &rhs)
Definition:
AntiSymTenzor.h:470
Inform.h
CoordinateSystemTrafo
Definition:
CoordinateSystemTrafo.h:8
CoordinateSystemTrafo::origin_m
Vector_t origin_m
Definition:
CoordinateSystemTrafo.h:35
CoordinateSystemTrafo::CoordinateSystemTrafo
CoordinateSystemTrafo()
Definition:
CoordinateSystemTrafo.cpp:6
CoordinateSystemTrafo::rotationMatrix_m
Tenzor< double, 3 > rotationMatrix_m
Definition:
CoordinateSystemTrafo.h:37
CoordinateSystemTrafo::operator*=
void operator*=(const CoordinateSystemTrafo &right)
Definition:
CoordinateSystemTrafo.cpp:38
CoordinateSystemTrafo::operator*
CoordinateSystemTrafo operator*(const CoordinateSystemTrafo &right) const
Definition:
CoordinateSystemTrafo.cpp:31
CoordinateSystemTrafo::orientation_m
Quaternion orientation_m
Definition:
CoordinateSystemTrafo.h:36
CoordinateSystemTrafo::invert
void invert()
Definition:
CoordinateSystemTrafo.cpp:25
Quaternion
Definition:
Quaternion.h:10
Quaternion::normalize
Quaternion & normalize()
Definition:
Quaternion.cpp:102
Quaternion::rotate
Vector_t rotate(const Vector_t &) const
Definition:
Quaternion.cpp:122
Quaternion::conjugate
Quaternion conjugate() const
Definition:
Quaternion.h:105
Quaternion::getRotationMatrix
Tenzor< double, 3 > getRotationMatrix() const
Definition:
Quaternion.cpp:135
Vektor< double, 3 >
Inform
Definition:
Inform.h:42
Generated on Wed Aug 25 2021 16:41:02 for OPAL (Object Oriented Parallel Accelerator Library) by
1.9.1