Logo ROOT  
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
5
9
11
13
14namespace ROOT {
15
16namespace ROOT_MATH_ARCH {
17
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
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
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
46{
47 // combination of a RotationX with a Rotation3D
48 // TODO -- recode for much better efficiency!
49 return Rotation3D(r1) * r2;
50}
51
53{
54 // combination of a RotationY with a Rotation3D
55 // TODO -- recode for much better efficiency!
56 return Rotation3D(r1) * r2;
57}
58
60{
61 // combination of a RotationZ with a Rotation3D
62 // TODO -- recode for much better efficiency!
63 return Rotation3D(r1) * r2;
64}
65
67
68// Rx * 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
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
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
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
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
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
#define c(i)
Definition RSha256.hxx:101
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Rotation class with the (3D) rotation represented by a 3x3 orthogonal matrix.
Definition Rotation3D.h:71
Rotation3D()
Default constructor (identity rotation)
AVector operator*(const AVector &v) const
Overload operator * for rotation on a vector.
Definition Rotation3D.h:445
Rotation class representing a 3D rotation about the X axis by the angle of rotation.
Definition RotationX.h:45
Scalar SinAngle() const
Sine or Cosine of the rotation angle.
Definition RotationX.h:105
Rotation class representing a 3D rotation about the Y axis by the angle of rotation.
Definition RotationY.h:45
Scalar SinAngle() const
Sine or Cosine of the rotation angle.
Definition RotationY.h:105
Rotation class representing a 3D rotation about the Z axis by the angle of rotation.
Definition RotationZ.h:45
Rotation3D::Scalar Scalar
AxisAngle operator*(RotationX const &r1, AxisAngle const &r2)
Multiplication of an axial rotation by an AxisAngle.