ROOT
git-r3/HEAD
Reference Guide
Loading...
Searching...
No Matches
Rotation3DxAxial.cxx
Go to the documentation of this file.
1
// @(#)root/mathcore:$Id$
2
// Authors: W. Brown, M. Fischler, L. Moneta 2005
3
4
#include "
MathX/GenVectorX/Rotation3D.h
"
5
6
#include "
MathX/GenVectorX/RotationX.h
"
7
#include "
MathX/GenVectorX/RotationY.h
"
8
#include "
MathX/GenVectorX/RotationZ.h
"
9
10
#include "
MathX/GenVectorX/AccHeaders.h
"
11
12
#include "
MathX/GenVectorX/MathHeaders.h
"
13
14
namespace
ROOT
{
15
16
namespace
ROOT_MATH_ARCH
{
17
18
Rotation3D
Rotation3D::operator*
(
const
RotationX
&rx)
const
19
{
20
// combination of a Rotation3D with a RotationX
21
Scalar
s = rx.
SinAngle
();
22
Scalar
c
= rx.
CosAngle
();
23
return
Rotation3D
(
fM
[
kXX
],
fM
[
kXY
] *
c
+
fM
[
kXZ
] * s,
fM
[
kXZ
] *
c
-
fM
[
kXY
] * s,
fM
[
kYX
],
fM
[
kYY
] *
c
+
fM
[
kYZ
] * s,
24
fM
[
kYZ
] *
c
-
fM
[
kYY
] * s,
fM
[
kZX
],
fM
[
kZY
] *
c
+
fM
[
kZZ
] * s,
fM
[
kZZ
] *
c
-
fM
[
kZY
] * s);
25
}
26
27
Rotation3D
Rotation3D::operator*
(
const
RotationY
&ry)
const
28
{
29
// combination of a Rotation3D with a RotationY
30
Scalar
s = ry.
SinAngle
();
31
Scalar
c
= ry.
CosAngle
();
32
return
Rotation3D
(
fM
[
kXX
] *
c
-
fM
[
kXZ
] * s,
fM
[
kXY
],
fM
[
kXX
] * s +
fM
[
kXZ
] *
c
,
fM
[
kYX
] *
c
-
fM
[
kYZ
] * s,
fM
[
kYY
],
33
fM
[
kYX
] * s +
fM
[
kYZ
] *
c
,
fM
[
kZX
] *
c
-
fM
[
kZZ
] * s,
fM
[
kZY
],
fM
[
kZX
] * s +
fM
[
kZZ
] *
c
);
34
}
35
36
Rotation3D
Rotation3D::operator*
(
const
RotationZ
&rz)
const
37
{
38
// combination of a Rotation3D with a RotationZ
39
Scalar
s = rz.
SinAngle
();
40
Scalar
c
= rz.
CosAngle
();
41
return
Rotation3D
(
fM
[
kXX
] *
c
+
fM
[
kXY
] * s,
fM
[
kXY
] *
c
-
fM
[
kXX
] * s,
fM
[
kXZ
],
fM
[
kYX
] *
c
+
fM
[
kYY
] * s,
42
fM
[
kYY
] *
c
-
fM
[
kYX
] * s,
fM
[
kYZ
],
fM
[
kZX
] *
c
+
fM
[
kZY
] * s,
fM
[
kZY
] *
c
-
fM
[
kZX
] * s,
fM
[
kZZ
]);
43
}
44
45
Rotation3D
operator*
(
RotationX
const
&r1,
Rotation3D
const
&r2)
46
{
47
// combination of a RotationX with a Rotation3D
48
// TODO -- recode for much better efficiency!
49
return
Rotation3D
(r1) * r2;
50
}
51
52
Rotation3D
operator*
(
RotationY
const
&r1,
Rotation3D
const
&r2)
53
{
54
// combination of a RotationY with a Rotation3D
55
// TODO -- recode for much better efficiency!
56
return
Rotation3D
(r1) * r2;
57
}
58
59
Rotation3D
operator*
(
RotationZ
const
&r1,
Rotation3D
const
&r2)
60
{
61
// combination of a RotationZ with a Rotation3D
62
// TODO -- recode for much better efficiency!
63
return
Rotation3D
(r1) * r2;
64
}
65
66
typedef
Rotation3D::Scalar
Scalar
;
67
68
// Rx * Ry
69
Rotation3D
operator*
(
RotationX
const
&rx,
RotationY
const
&ry)
70
{
71
Scalar
sx = rx.
SinAngle
();
72
Scalar
cx = rx.
CosAngle
();
73
Scalar
sy = ry.
SinAngle
();
74
Scalar
cy = ry.
CosAngle
();
75
return
Rotation3D
(cy, 0, sy, sx * sy, cx, -sx * cy, -sy * cx, sx, cx * cy);
76
}
77
78
// Rx * Rz
79
Rotation3D
operator*
(
RotationX
const
&rx,
RotationZ
const
&rz)
80
{
81
Scalar
sx = rx.
SinAngle
();
82
Scalar
cx = rx.
CosAngle
();
83
Scalar
sz = rz.
SinAngle
();
84
Scalar
cz = rz.
CosAngle
();
85
return
Rotation3D
(cz, -sz, 0, cx * sz, cx * cz, -sx, sx * sz, cz * sx, cx);
86
}
87
88
// Ry * Rx
89
Rotation3D
operator*
(
RotationY
const
&ry,
RotationX
const
&rx)
90
{
91
Scalar
sx = rx.
SinAngle
();
92
Scalar
cx = rx.
CosAngle
();
93
Scalar
sy = ry.
SinAngle
();
94
Scalar
cy = ry.
CosAngle
();
95
return
Rotation3D
(cy, sx * sy, sy * cx, 0, cx, -sx, -sy, cy * sx, cx * cy);
96
}
97
98
// Ry * Rz
99
Rotation3D
operator*
(
RotationY
const
&ry,
RotationZ
const
&rz)
100
{
101
Scalar
sy = ry.
SinAngle
();
102
Scalar
cy = ry.
CosAngle
();
103
Scalar
sz = rz.
SinAngle
();
104
Scalar
cz = rz.
CosAngle
();
105
return
Rotation3D
(cy * cz, -cy * sz, sy, sz, cz, 0, -cz * sy, sy * sz, cy);
106
}
107
108
// Rz * Rx
109
Rotation3D
operator*
(
RotationZ
const
&rz,
RotationX
const
&rx)
110
{
111
Scalar
sx = rx.
SinAngle
();
112
Scalar
cx = rx.
CosAngle
();
113
Scalar
sz = rz.
SinAngle
();
114
Scalar
cz = rz.
CosAngle
();
115
return
Rotation3D
(cz, -cx * sz, sx * sz, sz, cx * cz, -cz * sx, 0, sx, cx);
116
}
117
118
// Rz * Ry
119
Rotation3D
operator*
(
RotationZ
const
&rz,
RotationY
const
&ry)
120
{
121
Scalar
sy = ry.
SinAngle
();
122
Scalar
cy = ry.
CosAngle
();
123
Scalar
sz = rz.
SinAngle
();
124
Scalar
cz = rz.
CosAngle
();
125
return
Rotation3D
(cy * cz, -sz, cz * sy, cy * sz, cz, sy * sz, -sy, 0, cy);
126
}
127
128
}
// namespace ROOT_MATH_ARCH
129
}
// namespace ROOT
AccHeaders.h
MathHeaders.h
c
#define c(i)
Definition
RSha256.hxx:101
ROOT::ROOT_MATH_ARCH::Rotation3D
Rotation class with the (3D) rotation represented by a 3x3 orthogonal matrix.
Definition
Rotation3D.h:71
ROOT::ROOT_MATH_ARCH::Rotation3D::fM
Scalar fM[9]
Definition
Rotation3D.h:537
ROOT::ROOT_MATH_ARCH::Rotation3D::kXZ
@ kXZ
Definition
Rotation3D.h:79
ROOT::ROOT_MATH_ARCH::Rotation3D::kYZ
@ kYZ
Definition
Rotation3D.h:82
ROOT::ROOT_MATH_ARCH::Rotation3D::kXX
@ kXX
Definition
Rotation3D.h:77
ROOT::ROOT_MATH_ARCH::Rotation3D::kYX
@ kYX
Definition
Rotation3D.h:80
ROOT::ROOT_MATH_ARCH::Rotation3D::kXY
@ kXY
Definition
Rotation3D.h:78
ROOT::ROOT_MATH_ARCH::Rotation3D::kYY
@ kYY
Definition
Rotation3D.h:81
ROOT::ROOT_MATH_ARCH::Rotation3D::kZX
@ kZX
Definition
Rotation3D.h:83
ROOT::ROOT_MATH_ARCH::Rotation3D::kZZ
@ kZZ
Definition
Rotation3D.h:85
ROOT::ROOT_MATH_ARCH::Rotation3D::kZY
@ kZY
Definition
Rotation3D.h:84
ROOT::ROOT_MATH_ARCH::Rotation3D::Scalar
double Scalar
Definition
Rotation3D.h:74
ROOT::ROOT_MATH_ARCH::Rotation3D::Rotation3D
Rotation3D()
Default constructor (identity rotation).
Definition
Rotation3D.cxx:33
ROOT::ROOT_MATH_ARCH::Rotation3D::operator*
AVector operator*(const AVector &v) const
Overload operator * for rotation on a vector.
Definition
Rotation3D.h:445
ROOT::ROOT_MATH_ARCH::RotationX
Rotation class representing a 3D rotation about the X axis by the angle of rotation.
Definition
RotationX.h:45
ROOT::ROOT_MATH_ARCH::RotationX::SinAngle
Scalar SinAngle() const
Sine or Cosine of the rotation angle.
Definition
RotationX.h:105
ROOT::ROOT_MATH_ARCH::RotationX::CosAngle
Scalar CosAngle() const
Definition
RotationX.h:106
ROOT::ROOT_MATH_ARCH::RotationY
Rotation class representing a 3D rotation about the Y axis by the angle of rotation.
Definition
RotationY.h:45
ROOT::ROOT_MATH_ARCH::RotationY::CosAngle
Scalar CosAngle() const
Definition
RotationY.h:106
ROOT::ROOT_MATH_ARCH::RotationY::SinAngle
Scalar SinAngle() const
Sine or Cosine of the rotation angle.
Definition
RotationY.h:105
ROOT::ROOT_MATH_ARCH::RotationZ
Rotation class representing a 3D rotation about the Z axis by the angle of rotation.
Definition
RotationZ.h:45
ROOT::ROOT_MATH_ARCH::RotationZ::CosAngle
Scalar CosAngle() const
Definition
RotationZ.h:106
ROOT::ROOT_MATH_ARCH::RotationZ::SinAngle
Scalar SinAngle() const
Sine or Cosine of the rotation angle.
Definition
RotationZ.h:105
Rotation3D.h
RotationX.h
RotationY.h
RotationZ.h
ROOT::ROOT_MATH_ARCH
Definition
3DConversions.h:34
ROOT::ROOT_MATH_ARCH::Scalar
Rotation3D::Scalar Scalar
Definition
Rotation3DxAxial.cxx:66
ROOT::ROOT_MATH_ARCH::operator*
AxisAngle operator*(RotationX const &r1, AxisAngle const &r2)
Multiplication of an axial rotation by an AxisAngle.
Definition
AxisAngleXother.cxx:221
ROOT
Definition
EExecutionPolicy.hxx:4
math
experimental
genvectorx
src
Rotation3DxAxial.cxx
ROOTgit-r3/HEAD - Reference Guide Generated on
(GVA Time) using Doxygen 1.16.1