Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
3DDistances.cxx
Go to the documentation of this file.
1// @(#)root/mathcore:$Id$
2// Authors: W. Brown, M. Fischler, L. Moneta 2005
3
4 /**********************************************************************
5 * *
6 * Copyright (c) 2005, LCG ROOT FNAL MathLib Team *
7 * *
8 * *
9 **********************************************************************/
10
11// Source file for something else
12//
13// Created by: Mark Fischler Thurs July 7, 2005
14//
15// Last update: Wed Thurs July 7, 2005
16//
17
18
20
29
30#include <cmath>
31
32
33namespace ROOT {
34namespace Math {
35namespace gv_detail {
36
37
39{ kXX = 0, kXY = 1, kXZ = 2
40, kYX = 3, kYY = 4, kYZ = 5
41, kZX = 6, kZY = 7, kZZ = 8
42};
43
44
45// ----------------------------------------------------------------------
46// distance from Rotation3D
47
48double dist( Rotation3D const & from, Rotation3D const & to)
49{ /*TODO better */
50 return Quaternion(from).Distance(Quaternion(to));
51}
52
53double dist( Rotation3D const & from, AxisAngle const & to)
54{ return Quaternion(from).Distance(Quaternion(to));}
55
56double dist( Rotation3D const & from, EulerAngles const & to)
57{ return Quaternion(from).Distance(Quaternion(to)); }
58
59double dist( Rotation3D const & from, Quaternion const & to)
60{ return Quaternion(from).Distance(to); }
61
62double dist( Rotation3D const & from, RotationZYX const & to)
63{ /*TODO better */
64 return Quaternion(from).Distance(Quaternion(to));
65}
66double dist( Rotation3D const & from, RotationX const & to)
67{ /*TODO better */
68 return Quaternion(from).Distance(Quaternion(to));
69}
70
71double dist( Rotation3D const & from, RotationY const & to)
72{ /*TODO*/
73 return Quaternion(from).Distance(Quaternion(to));
74}
75
76double dist( Rotation3D const & from, RotationZ const & to)
77{ /*TODO*/
78 return Quaternion(from).Distance(Quaternion(to));
79}
80
81
82
83// ----------------------------------------------------------------------
84// distance from AxisAngle
85
86double dist( AxisAngle const & from, Rotation3D const & to)
87{ return Quaternion(from).Distance(Quaternion(to)); }
88
89double dist( AxisAngle const & from, AxisAngle const & to)
90{ /*TODO*/
91 return Quaternion(from).Distance(Quaternion(to));
92}
93
94double dist( AxisAngle const & from, EulerAngles const & to)
95{ return Quaternion(from).Distance(Quaternion(to)); }
96
97double dist( AxisAngle const & from, Quaternion const & to)
98{ return Quaternion(from).Distance(to); }
99
100double dist( AxisAngle const & from, RotationZYX const & to)
101{ /*TODO better */
102 return Quaternion(from).Distance(Quaternion(to));
103}
104
105double dist( AxisAngle const & from, RotationX const & to)
106{ /*TODO*/
107 return Quaternion(from).Distance(Quaternion(to));
108}
109
110double dist( AxisAngle const & from, RotationY const & to)
111{ /*TODO*/
112 return Quaternion(from).Distance(Quaternion(to));
113}
114
115double dist( AxisAngle const & from, RotationZ const & to)
116{ /*TODO*/
117 return Quaternion(from).Distance(Quaternion(to));
118}
119
120
121
122// ----------------------------------------------------------------------
123// distance from EulerAngles
124
125double dist( EulerAngles const & from, Rotation3D const & to)
126{ return Quaternion(from).Distance(Quaternion(to)); }
127
128double dist( EulerAngles const & from, AxisAngle const & to)
129{ return Quaternion(from).Distance(Quaternion(to)); }
130
131double dist( EulerAngles const & from, EulerAngles const & to)
132{ /*TODO*/
133 return Quaternion(from).Distance(Quaternion(to));
134}
135
136double dist( EulerAngles const & from, Quaternion const & to)
137{ return Quaternion(from).Distance(to); }
138
139double dist( EulerAngles const & from, RotationZYX const & to)
140{ /*TODO better */
141 return Quaternion(from).Distance(Quaternion(to));
142}
143
144double dist( EulerAngles const & from, RotationX const & to)
145{ /*TODO*/
146 return Quaternion(from).Distance(Quaternion(to));
147}
148
149double dist( EulerAngles const & from, RotationY const & to)
150{ /*TODO*/
151 return Quaternion(from).Distance(Quaternion(to));
152}
153
154double dist( EulerAngles const & from, RotationZ const & to)
155{ /*TODO*/
156 return Quaternion(from).Distance(Quaternion(to));
157}
158
159
160
161// ----------------------------------------------------------------------
162// distance from Quaternion
163
164double dist( Quaternion const & from, Rotation3D const & to)
165{ return from.Distance(Quaternion(to)); }
166
167double dist( Quaternion const & from, AxisAngle const & to)
168{ return from.Distance(Quaternion(to)); }
169
170double dist( Quaternion const & from, EulerAngles const & to)
171{ return from.Distance(Quaternion(to)); }
172
173double dist( Quaternion const & from, Quaternion const & to)
174{ return from.Distance(to); }
175
176double dist( Quaternion const & from, RotationZYX const & to)
177{ return from.Distance(Quaternion(to)); }
178
179double dist( Quaternion const & from, RotationX const & to)
180{ /*TODO*/
181 return from.Distance(Quaternion(to));
182}
183
184double dist( Quaternion const & from, RotationY const & to)
185{ /*TODO*/
186 return from.Distance(Quaternion(to));
187}
188
189double dist( Quaternion const & from, RotationZ const & to)
190{ /*TODO*/
191 return from.Distance(Quaternion(to));
192}
193
194// ----------------------------------------------------------------------
195// distance from RotationZYX
196
197double dist( RotationZYX const & from, Rotation3D const & to)
198{ return Quaternion(from).Distance(Quaternion(to)); }
199
200double dist( RotationZYX const & from, AxisAngle const & to)
201{ return Quaternion(from).Distance(Quaternion(to)); }
202
203double dist( RotationZYX const & from, EulerAngles const & to)
204{ return Quaternion(from).Distance(Quaternion(to)); }
205
206double dist( RotationZYX const & from, Quaternion const & to)
207{ return Quaternion(from).Distance(to); }
208
209double dist( RotationZYX const & from, RotationZYX const & to)
210{ /*TODO better */
211 return Quaternion(from).Distance(Quaternion(to));
212}
213
214double dist( RotationZYX const & from, RotationX const & to)
215{ /*TODO*/
216 return Quaternion(from).Distance(Quaternion(to));
217}
218
219double dist( RotationZYX const & from, RotationY const & to)
220{ /*TODO*/
221 return Quaternion(from).Distance(Quaternion(to));
222}
223
224double dist( RotationZYX const & from, RotationZ const & to)
225{ /*TODO*/
226 return Quaternion(from).Distance(Quaternion(to));
227}
228
229
230
231// ----------------------------------------------------------------------
232// distance from RotationX
233
234double dist( RotationX const & from, Rotation3D const & to)
235{ return Quaternion(from).Distance(Quaternion(to)); }
236
237double dist( RotationX const & from, AxisAngle const & to)
238{ return Quaternion(from).Distance(Quaternion(to)); }
239
240double dist( RotationX const & from, EulerAngles const & to)
241{ return Quaternion(from).Distance(Quaternion(to)); }
242
243double dist( RotationX const & from, Quaternion const & to)
244{ return Quaternion(from).Distance(to); }
245
246double dist( RotationX const & from, RotationZYX const & to)
247{ /*TODO better */
248 return Quaternion(from).Distance(Quaternion(to));
249}
250
251double dist( RotationX const & from, RotationX const & to)
252{ /*TODO*/
253 return Quaternion(from).Distance(Quaternion(to));
254}
255
256double dist( RotationX const & from, RotationY const & to)
257{ /*TODO*/
258 return Quaternion(from).Distance(Quaternion(to));
259}
260
261double dist( RotationX const & from, RotationZ const & to)
262{ /*TODO*/
263 return Quaternion(from).Distance(Quaternion(to));
264}
265
266
267
268// ----------------------------------------------------------------------
269// distance from RotationY
270
271double dist( RotationY const & from, Rotation3D const & to)
272{ return Quaternion(from).Distance(Quaternion(to)); }
273
274double dist( RotationY const & from, AxisAngle const & to)
275{ return Quaternion(from).Distance(Quaternion(to)); }
276
277double dist( RotationY const & from, EulerAngles const & to)
278{ return Quaternion(from).Distance(Quaternion(to)); }
279
280double dist( RotationY const & from, Quaternion const & to)
281{ return Quaternion(from).Distance(to); }
282
283double dist( RotationY const & from, RotationZYX const & to)
284{ /*TODO better */
285 return Quaternion(from).Distance(Quaternion(to));
286}
287
288double dist( RotationY const & from, RotationX const & to)
289{ /*TODO*/
290 return Quaternion(from).Distance(Quaternion(to));
291}
292
293double dist( RotationY const & from, RotationY const & to)
294{ /*TODO*/
295 return Quaternion(from).Distance(Quaternion(to));
296}
297
298double dist( RotationY const & from, RotationZ const & to)
299{ /*TODO*/
300 return Quaternion(from).Distance(Quaternion(to));
301}
302
303
304
305// ----------------------------------------------------------------------
306// distance from RotationZ
307
308double dist( RotationZ const & from, Rotation3D const & to)
309{ return Quaternion(from).Distance(Quaternion(to)); }
310
311double dist( RotationZ const & from, AxisAngle const & to)
312{ return Quaternion(from).Distance(Quaternion(to)); }
313
314double dist( RotationZ const & from, EulerAngles const & to)
315{ return Quaternion(from).Distance(Quaternion(to)); }
316
317double dist( RotationZ const & from, Quaternion const & to)
318{ return Quaternion(from).Distance(to); }
319
320double dist( RotationZ const & from, RotationZYX const & to)
321{ /*TODO better */
322 return Quaternion(from).Distance(Quaternion(to));
323}
324
325double dist( RotationZ const & from, RotationX const & to)
326{ /*TODO*/
327 return Quaternion(from).Distance(Quaternion(to));
328}
329
330double dist( RotationZ const & from, RotationY const & to)
331{ /*TODO*/
332 return Quaternion(from).Distance(Quaternion(to));
333}
334
335double dist( RotationZ const & from, RotationZ const & to)
336{ /*TODO*/
337 return Quaternion(from).Distance(Quaternion(to));
338}
339
340
341} //namespace gv_detail
342} //namespace Math
343} //namespace ROOT
AxisAngle class describing rotation represented with direction axis (3D Vector) and an angle of rotat...
Definition AxisAngle.h:41
EulerAngles class describing rotation as three angles (Euler Angles).
Definition EulerAngles.h:43
Rotation class with the (3D) rotation represented by a unit quaternion (u, i, j, k).
Definition Quaternion.h:47
Scalar Distance(const Quaternion &q) const
Distance between two rotations in Quaternion form Note: The rotation group is isomorphic to a 3-spher...
Rotation class with the (3D) rotation represented by a 3x3 orthogonal matrix.
Definition Rotation3D.h:65
Rotation class representing a 3D rotation about the X axis by the angle of rotation.
Definition RotationX.h:43
Rotation class representing a 3D rotation about the Y axis by the angle of rotation.
Definition RotationY.h:43
Rotation class with the (3D) rotation represented by angles describing first a rotation of an angle p...
Definition RotationZYX.h:61
Rotation class representing a 3D rotation about the Z axis by the angle of rotation.
Definition RotationZ.h:43
Namespace for new Math classes and functions.
double dist(Rotation3D const &r1, Rotation3D const &r2)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...