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
19
28
29#include <cmath>
30
32
34
35namespace ROOT {
36namespace ROOT_MATH_ARCH {
37namespace gv_detail {
38
40 kXX = 0,
41 kXY = 1,
42 kXZ = 2,
43 kYX = 3,
44 kYY = 4,
45 kYZ = 5,
46 kZX = 6,
47 kZY = 7,
48 kZZ = 8
49};
50
51// ----------------------------------------------------------------------
52// distance from Rotation3D
53
54double dist(Rotation3D const &from, Rotation3D const &to)
55{ /*TODO better */
56 return Quaternion(from).Distance(Quaternion(to));
57}
58
59double dist(Rotation3D const &from, AxisAngle const &to)
60{
61 return Quaternion(from).Distance(Quaternion(to));
62}
63
64double dist(Rotation3D const &from, EulerAngles const &to)
65{
66 return Quaternion(from).Distance(Quaternion(to));
67}
68
69double dist(Rotation3D const &from, Quaternion const &to)
70{
71 return Quaternion(from).Distance(to);
72}
73
74double dist(Rotation3D const &from, RotationZYX const &to)
75{ /*TODO better */
76 return Quaternion(from).Distance(Quaternion(to));
77}
78double dist(Rotation3D const &from, RotationX const &to)
79{ /*TODO better */
80 return Quaternion(from).Distance(Quaternion(to));
81}
82
83double dist(Rotation3D const &from, RotationY const &to)
84{ /*TODO*/
85 return Quaternion(from).Distance(Quaternion(to));
86}
87
88double dist(Rotation3D const &from, RotationZ const &to)
89{ /*TODO*/
90 return Quaternion(from).Distance(Quaternion(to));
91}
92
93// ----------------------------------------------------------------------
94// distance from AxisAngle
95
96double dist(AxisAngle const &from, Rotation3D const &to)
97{
98 return Quaternion(from).Distance(Quaternion(to));
99}
100
101double dist(AxisAngle const &from, AxisAngle const &to)
102{ /*TODO*/
103 return Quaternion(from).Distance(Quaternion(to));
104}
105
106double dist(AxisAngle const &from, EulerAngles const &to)
107{
108 return Quaternion(from).Distance(Quaternion(to));
109}
110
111double dist(AxisAngle const &from, Quaternion const &to)
112{
113 return Quaternion(from).Distance(to);
114}
115
116double dist(AxisAngle const &from, RotationZYX const &to)
117{ /*TODO better */
118 return Quaternion(from).Distance(Quaternion(to));
119}
120
121double dist(AxisAngle const &from, RotationX const &to)
122{ /*TODO*/
123 return Quaternion(from).Distance(Quaternion(to));
124}
125
126double dist(AxisAngle const &from, RotationY const &to)
127{ /*TODO*/
128 return Quaternion(from).Distance(Quaternion(to));
129}
130
131double dist(AxisAngle const &from, RotationZ const &to)
132{ /*TODO*/
133 return Quaternion(from).Distance(Quaternion(to));
134}
135
136// ----------------------------------------------------------------------
137// distance from EulerAngles
138
139double dist(EulerAngles const &from, Rotation3D const &to)
140{
141 return Quaternion(from).Distance(Quaternion(to));
142}
143
144double dist(EulerAngles const &from, AxisAngle const &to)
145{
146 return Quaternion(from).Distance(Quaternion(to));
147}
148
149double dist(EulerAngles const &from, EulerAngles const &to)
150{ /*TODO*/
151 return Quaternion(from).Distance(Quaternion(to));
152}
153
154double dist(EulerAngles const &from, Quaternion const &to)
155{
156 return Quaternion(from).Distance(to);
157}
158
159double dist(EulerAngles const &from, RotationZYX const &to)
160{ /*TODO better */
161 return Quaternion(from).Distance(Quaternion(to));
162}
163
164double dist(EulerAngles const &from, RotationX const &to)
165{ /*TODO*/
166 return Quaternion(from).Distance(Quaternion(to));
167}
168
169double dist(EulerAngles const &from, RotationY const &to)
170{ /*TODO*/
171 return Quaternion(from).Distance(Quaternion(to));
172}
173
174double dist(EulerAngles const &from, RotationZ const &to)
175{ /*TODO*/
176 return Quaternion(from).Distance(Quaternion(to));
177}
178
179// ----------------------------------------------------------------------
180// distance from Quaternion
181
182double dist(Quaternion const &from, Rotation3D const &to)
183{
184 return from.Distance(Quaternion(to));
185}
186
187double dist(Quaternion const &from, AxisAngle const &to)
188{
189 return from.Distance(Quaternion(to));
190}
191
192double dist(Quaternion const &from, EulerAngles const &to)
193{
194 return from.Distance(Quaternion(to));
195}
196
197double dist(Quaternion const &from, Quaternion const &to)
198{
199 return from.Distance(to);
200}
201
202double dist(Quaternion const &from, RotationZYX const &to)
203{
204 return from.Distance(Quaternion(to));
205}
206
207double dist(Quaternion const &from, RotationX const &to)
208{ /*TODO*/
209 return from.Distance(Quaternion(to));
210}
211
212double dist(Quaternion const &from, RotationY const &to)
213{ /*TODO*/
214 return from.Distance(Quaternion(to));
215}
216
217double dist(Quaternion const &from, RotationZ const &to)
218{ /*TODO*/
219 return from.Distance(Quaternion(to));
220}
221
222// ----------------------------------------------------------------------
223// distance from RotationZYX
224
225double dist(RotationZYX const &from, Rotation3D const &to)
226{
227 return Quaternion(from).Distance(Quaternion(to));
228}
229
230double dist(RotationZYX const &from, AxisAngle const &to)
231{
232 return Quaternion(from).Distance(Quaternion(to));
233}
234
235double dist(RotationZYX const &from, EulerAngles const &to)
236{
237 return Quaternion(from).Distance(Quaternion(to));
238}
239
240double dist(RotationZYX const &from, Quaternion const &to)
241{
242 return Quaternion(from).Distance(to);
243}
244
245double dist(RotationZYX const &from, RotationZYX const &to)
246{ /*TODO better */
247 return Quaternion(from).Distance(Quaternion(to));
248}
249
250double dist(RotationZYX const &from, RotationX const &to)
251{ /*TODO*/
252 return Quaternion(from).Distance(Quaternion(to));
253}
254
255double dist(RotationZYX const &from, RotationY const &to)
256{ /*TODO*/
257 return Quaternion(from).Distance(Quaternion(to));
258}
259
260double dist(RotationZYX const &from, RotationZ const &to)
261{ /*TODO*/
262 return Quaternion(from).Distance(Quaternion(to));
263}
264
265// ----------------------------------------------------------------------
266// distance from RotationX
267
268double dist(RotationX const &from, Rotation3D const &to)
269{
270 return Quaternion(from).Distance(Quaternion(to));
271}
272
273double dist(RotationX const &from, AxisAngle const &to)
274{
275 return Quaternion(from).Distance(Quaternion(to));
276}
277
278double dist(RotationX const &from, EulerAngles const &to)
279{
280 return Quaternion(from).Distance(Quaternion(to));
281}
282
283double dist(RotationX const &from, Quaternion const &to)
284{
285 return Quaternion(from).Distance(to);
286}
287
288double dist(RotationX const &from, RotationZYX const &to)
289{ /*TODO better */
290 return Quaternion(from).Distance(Quaternion(to));
291}
292
293double dist(RotationX const &from, RotationX const &to)
294{ /*TODO*/
295 return Quaternion(from).Distance(Quaternion(to));
296}
297
298double dist(RotationX const &from, RotationY const &to)
299{ /*TODO*/
300 return Quaternion(from).Distance(Quaternion(to));
301}
302
303double dist(RotationX const &from, RotationZ const &to)
304{ /*TODO*/
305 return Quaternion(from).Distance(Quaternion(to));
306}
307
308// ----------------------------------------------------------------------
309// distance from RotationY
310
311double dist(RotationY const &from, Rotation3D const &to)
312{
313 return Quaternion(from).Distance(Quaternion(to));
314}
315
316double dist(RotationY const &from, AxisAngle const &to)
317{
318 return Quaternion(from).Distance(Quaternion(to));
319}
320
321double dist(RotationY const &from, EulerAngles const &to)
322{
323 return Quaternion(from).Distance(Quaternion(to));
324}
325
326double dist(RotationY const &from, Quaternion const &to)
327{
328 return Quaternion(from).Distance(to);
329}
330
331double dist(RotationY const &from, RotationZYX const &to)
332{ /*TODO better */
333 return Quaternion(from).Distance(Quaternion(to));
334}
335
336double dist(RotationY const &from, RotationX const &to)
337{ /*TODO*/
338 return Quaternion(from).Distance(Quaternion(to));
339}
340
341double dist(RotationY const &from, RotationY const &to)
342{ /*TODO*/
343 return Quaternion(from).Distance(Quaternion(to));
344}
345
346double dist(RotationY const &from, RotationZ const &to)
347{ /*TODO*/
348 return Quaternion(from).Distance(Quaternion(to));
349}
350
351// ----------------------------------------------------------------------
352// distance from RotationZ
353
354double dist(RotationZ const &from, Rotation3D const &to)
355{
356 return Quaternion(from).Distance(Quaternion(to));
357}
358
359double dist(RotationZ const &from, AxisAngle const &to)
360{
361 return Quaternion(from).Distance(Quaternion(to));
362}
363
364double dist(RotationZ const &from, EulerAngles const &to)
365{
366 return Quaternion(from).Distance(Quaternion(to));
367}
368
369double dist(RotationZ const &from, Quaternion const &to)
370{
371 return Quaternion(from).Distance(to);
372}
373
374double dist(RotationZ const &from, RotationZYX const &to)
375{ /*TODO better */
376 return Quaternion(from).Distance(Quaternion(to));
377}
378
379double dist(RotationZ const &from, RotationX const &to)
380{ /*TODO*/
381 return Quaternion(from).Distance(Quaternion(to));
382}
383
384double dist(RotationZ const &from, RotationY const &to)
385{ /*TODO*/
386 return Quaternion(from).Distance(Quaternion(to));
387}
388
389double dist(RotationZ const &from, RotationZ const &to)
390{ /*TODO*/
391 return Quaternion(from).Distance(Quaternion(to));
392}
393
394} // namespace gv_detail
395} // namespace ROOT_MATH_ARCH
396} // namespace ROOT
AxisAngle class describing rotation represented with direction axis (3D Vector) and an angle of rotat...
Definition AxisAngle.h:46
EulerAngles class describing rotation as three angles (Euler Angles).
Definition EulerAngles.h:50
Rotation class with the (3D) rotation represented by a unit quaternion (u, i, j, k).
Definition Quaternion.h:52
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:71
Rotation class representing a 3D rotation about the X axis by the angle of rotation.
Definition RotationX.h:45
Rotation class representing a 3D rotation about the Y axis by the angle of rotation.
Definition RotationY.h:45
Rotation class with the (3D) rotation represented by angles describing first a rotation of an angle p...
Definition RotationZYX.h:64
Rotation class representing a 3D rotation about the Z axis by the angle of rotation.
Definition RotationZ.h:45
double dist(Rotation3D const &r1, Rotation3D const &r2)