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// ----------------------------------------------------------------------
38// distance from Rotation3D
39
40double dist( Rotation3D const & from, Rotation3D const & to)
41{ /*TODO better */
42 return Quaternion(from).Distance(Quaternion(to));
43}
44
45double dist( Rotation3D const & from, AxisAngle const & to)
46{ return Quaternion(from).Distance(Quaternion(to));}
47
48double dist( Rotation3D const & from, EulerAngles const & to)
49{ return Quaternion(from).Distance(Quaternion(to)); }
50
51double dist( Rotation3D const & from, Quaternion const & to)
52{ return Quaternion(from).Distance(to); }
53
54double dist( Rotation3D const & from, RotationZYX const & to)
55{ /*TODO better */
56 return Quaternion(from).Distance(Quaternion(to));
57}
58double dist( Rotation3D const & from, RotationX const & to)
59{ /*TODO better */
60 return Quaternion(from).Distance(Quaternion(to));
61}
62
63double dist( Rotation3D const & from, RotationY const & to)
64{ /*TODO*/
65 return Quaternion(from).Distance(Quaternion(to));
66}
67
68double dist( Rotation3D const & from, RotationZ const & to)
69{ /*TODO*/
70 return Quaternion(from).Distance(Quaternion(to));
71}
72
73
74
75// ----------------------------------------------------------------------
76// distance from AxisAngle
77
78double dist( AxisAngle const & from, Rotation3D const & to)
79{ return Quaternion(from).Distance(Quaternion(to)); }
80
81double dist( AxisAngle const & from, AxisAngle const & to)
82{ /*TODO*/
83 return Quaternion(from).Distance(Quaternion(to));
84}
85
86double dist( AxisAngle const & from, EulerAngles const & to)
87{ return Quaternion(from).Distance(Quaternion(to)); }
88
89double dist( AxisAngle const & from, Quaternion const & to)
90{ return Quaternion(from).Distance(to); }
91
92double dist( AxisAngle const & from, RotationZYX const & to)
93{ /*TODO better */
94 return Quaternion(from).Distance(Quaternion(to));
95}
96
97double dist( AxisAngle const & from, RotationX const & to)
98{ /*TODO*/
99 return Quaternion(from).Distance(Quaternion(to));
100}
101
102double dist( AxisAngle const & from, RotationY const & to)
103{ /*TODO*/
104 return Quaternion(from).Distance(Quaternion(to));
105}
106
107double dist( AxisAngle const & from, RotationZ const & to)
108{ /*TODO*/
109 return Quaternion(from).Distance(Quaternion(to));
110}
111
112
113
114// ----------------------------------------------------------------------
115// distance from EulerAngles
116
117double dist( EulerAngles const & from, Rotation3D const & to)
118{ return Quaternion(from).Distance(Quaternion(to)); }
119
120double dist( EulerAngles const & from, AxisAngle const & to)
121{ return Quaternion(from).Distance(Quaternion(to)); }
122
123double dist( EulerAngles const & from, EulerAngles const & to)
124{ /*TODO*/
125 return Quaternion(from).Distance(Quaternion(to));
126}
127
128double dist( EulerAngles const & from, Quaternion const & to)
129{ return Quaternion(from).Distance(to); }
130
131double dist( EulerAngles const & from, RotationZYX const & to)
132{ /*TODO better */
133 return Quaternion(from).Distance(Quaternion(to));
134}
135
136double dist( EulerAngles const & from, RotationX const & to)
137{ /*TODO*/
138 return Quaternion(from).Distance(Quaternion(to));
139}
140
141double dist( EulerAngles const & from, RotationY const & to)
142{ /*TODO*/
143 return Quaternion(from).Distance(Quaternion(to));
144}
145
146double dist( EulerAngles const & from, RotationZ const & to)
147{ /*TODO*/
148 return Quaternion(from).Distance(Quaternion(to));
149}
150
151
152
153// ----------------------------------------------------------------------
154// distance from Quaternion
155
156double dist( Quaternion const & from, Rotation3D const & to)
157{ return from.Distance(Quaternion(to)); }
158
159double dist( Quaternion const & from, AxisAngle const & to)
160{ return from.Distance(Quaternion(to)); }
161
162double dist( Quaternion const & from, EulerAngles const & to)
163{ return from.Distance(Quaternion(to)); }
164
165double dist( Quaternion const & from, Quaternion const & to)
166{ return from.Distance(to); }
167
168double dist( Quaternion const & from, RotationZYX const & to)
169{ return from.Distance(Quaternion(to)); }
170
171double dist( Quaternion const & from, RotationX const & to)
172{ /*TODO*/
173 return from.Distance(Quaternion(to));
174}
175
176double dist( Quaternion const & from, RotationY const & to)
177{ /*TODO*/
178 return from.Distance(Quaternion(to));
179}
180
181double dist( Quaternion const & from, RotationZ const & to)
182{ /*TODO*/
183 return from.Distance(Quaternion(to));
184}
185
186// ----------------------------------------------------------------------
187// distance from RotationZYX
188
189double dist( RotationZYX const & from, Rotation3D const & to)
190{ return Quaternion(from).Distance(Quaternion(to)); }
191
192double dist( RotationZYX const & from, AxisAngle const & to)
193{ return Quaternion(from).Distance(Quaternion(to)); }
194
195double dist( RotationZYX const & from, EulerAngles const & to)
196{ return Quaternion(from).Distance(Quaternion(to)); }
197
198double dist( RotationZYX const & from, Quaternion const & to)
199{ return Quaternion(from).Distance(to); }
200
201double dist( RotationZYX const & from, RotationZYX const & to)
202{ /*TODO better */
203 return Quaternion(from).Distance(Quaternion(to));
204}
205
206double dist( RotationZYX const & from, RotationX const & to)
207{ /*TODO*/
208 return Quaternion(from).Distance(Quaternion(to));
209}
210
211double dist( RotationZYX const & from, RotationY const & to)
212{ /*TODO*/
213 return Quaternion(from).Distance(Quaternion(to));
214}
215
216double dist( RotationZYX const & from, RotationZ const & to)
217{ /*TODO*/
218 return Quaternion(from).Distance(Quaternion(to));
219}
220
221
222
223// ----------------------------------------------------------------------
224// distance from RotationX
225
226double dist( RotationX const & from, Rotation3D const & to)
227{ return Quaternion(from).Distance(Quaternion(to)); }
228
229double dist( RotationX const & from, AxisAngle const & to)
230{ return Quaternion(from).Distance(Quaternion(to)); }
231
232double dist( RotationX const & from, EulerAngles const & to)
233{ return Quaternion(from).Distance(Quaternion(to)); }
234
235double dist( RotationX const & from, Quaternion const & to)
236{ return Quaternion(from).Distance(to); }
237
238double dist( RotationX const & from, RotationZYX const & to)
239{ /*TODO better */
240 return Quaternion(from).Distance(Quaternion(to));
241}
242
243double dist( RotationX const & from, RotationX const & to)
244{ /*TODO*/
245 return Quaternion(from).Distance(Quaternion(to));
246}
247
248double dist( RotationX const & from, RotationY const & to)
249{ /*TODO*/
250 return Quaternion(from).Distance(Quaternion(to));
251}
252
253double dist( RotationX const & from, RotationZ const & to)
254{ /*TODO*/
255 return Quaternion(from).Distance(Quaternion(to));
256}
257
258
259
260// ----------------------------------------------------------------------
261// distance from RotationY
262
263double dist( RotationY const & from, Rotation3D const & to)
264{ return Quaternion(from).Distance(Quaternion(to)); }
265
266double dist( RotationY const & from, AxisAngle const & to)
267{ return Quaternion(from).Distance(Quaternion(to)); }
268
269double dist( RotationY const & from, EulerAngles const & to)
270{ return Quaternion(from).Distance(Quaternion(to)); }
271
272double dist( RotationY const & from, Quaternion const & to)
273{ return Quaternion(from).Distance(to); }
274
275double dist( RotationY const & from, RotationZYX const & to)
276{ /*TODO better */
277 return Quaternion(from).Distance(Quaternion(to));
278}
279
280double dist( RotationY const & from, RotationX const & to)
281{ /*TODO*/
282 return Quaternion(from).Distance(Quaternion(to));
283}
284
285double dist( RotationY const & from, RotationY const & to)
286{ /*TODO*/
287 return Quaternion(from).Distance(Quaternion(to));
288}
289
290double dist( RotationY const & from, RotationZ const & to)
291{ /*TODO*/
292 return Quaternion(from).Distance(Quaternion(to));
293}
294
295
296
297// ----------------------------------------------------------------------
298// distance from RotationZ
299
300double dist( RotationZ const & from, Rotation3D const & to)
301{ return Quaternion(from).Distance(Quaternion(to)); }
302
303double dist( RotationZ const & from, AxisAngle const & to)
304{ return Quaternion(from).Distance(Quaternion(to)); }
305
306double dist( RotationZ const & from, EulerAngles const & to)
307{ return Quaternion(from).Distance(Quaternion(to)); }
308
309double dist( RotationZ const & from, Quaternion const & to)
310{ return Quaternion(from).Distance(to); }
311
312double dist( RotationZ const & from, RotationZYX const & to)
313{ /*TODO better */
314 return Quaternion(from).Distance(Quaternion(to));
315}
316
317double dist( RotationZ const & from, RotationX const & to)
318{ /*TODO*/
319 return Quaternion(from).Distance(Quaternion(to));
320}
321
322double dist( RotationZ const & from, RotationY const & to)
323{ /*TODO*/
324 return Quaternion(from).Distance(Quaternion(to));
325}
326
327double dist( RotationZ const & from, RotationZ const & to)
328{ /*TODO*/
329 return Quaternion(from).Distance(Quaternion(to));
330}
331
332
333} //namespace gv_detail
334} //namespace Math
335} //namespace ROOT
AxisAngle class describing rotation represented with direction axis (3D Vector) and an angle of rotat...
Definition AxisAngle.h:42
EulerAngles class describing rotation as three angles (Euler Angles).
Definition EulerAngles.h:46
Rotation class with the (3D) rotation represented by a unit quaternion (u, i, j, k).
Definition Quaternion.h:49
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:68
Rotation class representing a 3D rotation about the X axis by the angle of rotation.
Definition RotationX.h:46
Rotation class representing a 3D rotation about the Y axis by the angle of rotation.
Definition RotationY.h:46
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:46
Namespace for new Math classes and functions.
double dist(Rotation3D const &r1, Rotation3D const &r2)