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
39// ----------------------------------------------------------------------
40// distance from Rotation3D
41
42double dist(Rotation3D const &from, Rotation3D const &to)
43{ /*TODO better */
44 return Quaternion(from).Distance(Quaternion(to));
45}
46
47double dist(Rotation3D const &from, AxisAngle const &to)
48{
49 return Quaternion(from).Distance(Quaternion(to));
50}
51
52double dist(Rotation3D const &from, EulerAngles const &to)
53{
54 return Quaternion(from).Distance(Quaternion(to));
55}
56
57double dist(Rotation3D const &from, Quaternion const &to)
58{
59 return Quaternion(from).Distance(to);
60}
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// distance from AxisAngle
83
84double dist(AxisAngle const &from, Rotation3D const &to)
85{
86 return Quaternion(from).Distance(Quaternion(to));
87}
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{
96 return Quaternion(from).Distance(Quaternion(to));
97}
98
99double dist(AxisAngle const &from, Quaternion const &to)
100{
101 return Quaternion(from).Distance(to);
102}
103
104double dist(AxisAngle const &from, RotationZYX const &to)
105{ /*TODO better */
106 return Quaternion(from).Distance(Quaternion(to));
107}
108
109double dist(AxisAngle const &from, RotationX const &to)
110{ /*TODO*/
111 return Quaternion(from).Distance(Quaternion(to));
112}
113
114double dist(AxisAngle const &from, RotationY const &to)
115{ /*TODO*/
116 return Quaternion(from).Distance(Quaternion(to));
117}
118
119double dist(AxisAngle const &from, RotationZ const &to)
120{ /*TODO*/
121 return Quaternion(from).Distance(Quaternion(to));
122}
123
124// ----------------------------------------------------------------------
125// distance from EulerAngles
126
127double dist(EulerAngles const &from, Rotation3D const &to)
128{
129 return Quaternion(from).Distance(Quaternion(to));
130}
131
132double dist(EulerAngles const &from, AxisAngle const &to)
133{
134 return Quaternion(from).Distance(Quaternion(to));
135}
136
137double dist(EulerAngles const &from, EulerAngles const &to)
138{ /*TODO*/
139 return Quaternion(from).Distance(Quaternion(to));
140}
141
142double dist(EulerAngles const &from, Quaternion const &to)
143{
144 return Quaternion(from).Distance(to);
145}
146
147double dist(EulerAngles const &from, RotationZYX const &to)
148{ /*TODO better */
149 return Quaternion(from).Distance(Quaternion(to));
150}
151
152double dist(EulerAngles const &from, RotationX const &to)
153{ /*TODO*/
154 return Quaternion(from).Distance(Quaternion(to));
155}
156
157double dist(EulerAngles const &from, RotationY const &to)
158{ /*TODO*/
159 return Quaternion(from).Distance(Quaternion(to));
160}
161
162double dist(EulerAngles const &from, RotationZ const &to)
163{ /*TODO*/
164 return Quaternion(from).Distance(Quaternion(to));
165}
166
167// ----------------------------------------------------------------------
168// distance from Quaternion
169
170double dist(Quaternion const &from, Rotation3D const &to)
171{
172 return from.Distance(Quaternion(to));
173}
174
175double dist(Quaternion const &from, AxisAngle const &to)
176{
177 return from.Distance(Quaternion(to));
178}
179
180double dist(Quaternion const &from, EulerAngles const &to)
181{
182 return from.Distance(Quaternion(to));
183}
184
185double dist(Quaternion const &from, Quaternion const &to)
186{
187 return from.Distance(to);
188}
189
190double dist(Quaternion const &from, RotationZYX const &to)
191{
192 return from.Distance(Quaternion(to));
193}
194
195double dist(Quaternion const &from, RotationX const &to)
196{ /*TODO*/
197 return from.Distance(Quaternion(to));
198}
199
200double dist(Quaternion const &from, RotationY const &to)
201{ /*TODO*/
202 return from.Distance(Quaternion(to));
203}
204
205double dist(Quaternion const &from, RotationZ const &to)
206{ /*TODO*/
207 return from.Distance(Quaternion(to));
208}
209
210// ----------------------------------------------------------------------
211// distance from RotationZYX
212
213double dist(RotationZYX const &from, Rotation3D const &to)
214{
215 return Quaternion(from).Distance(Quaternion(to));
216}
217
218double dist(RotationZYX const &from, AxisAngle const &to)
219{
220 return Quaternion(from).Distance(Quaternion(to));
221}
222
223double dist(RotationZYX const &from, EulerAngles const &to)
224{
225 return Quaternion(from).Distance(Quaternion(to));
226}
227
228double dist(RotationZYX const &from, Quaternion const &to)
229{
230 return Quaternion(from).Distance(to);
231}
232
233double dist(RotationZYX const &from, RotationZYX const &to)
234{ /*TODO better */
235 return Quaternion(from).Distance(Quaternion(to));
236}
237
238double dist(RotationZYX const &from, RotationX const &to)
239{ /*TODO*/
240 return Quaternion(from).Distance(Quaternion(to));
241}
242
243double dist(RotationZYX const &from, RotationY const &to)
244{ /*TODO*/
245 return Quaternion(from).Distance(Quaternion(to));
246}
247
248double dist(RotationZYX const &from, RotationZ const &to)
249{ /*TODO*/
250 return Quaternion(from).Distance(Quaternion(to));
251}
252
253// ----------------------------------------------------------------------
254// distance from RotationX
255
256double dist(RotationX const &from, Rotation3D const &to)
257{
258 return Quaternion(from).Distance(Quaternion(to));
259}
260
261double dist(RotationX const &from, AxisAngle const &to)
262{
263 return Quaternion(from).Distance(Quaternion(to));
264}
265
266double dist(RotationX const &from, EulerAngles const &to)
267{
268 return Quaternion(from).Distance(Quaternion(to));
269}
270
271double dist(RotationX const &from, Quaternion const &to)
272{
273 return Quaternion(from).Distance(to);
274}
275
276double dist(RotationX const &from, RotationZYX const &to)
277{ /*TODO better */
278 return Quaternion(from).Distance(Quaternion(to));
279}
280
281double dist(RotationX const &from, RotationX const &to)
282{ /*TODO*/
283 return Quaternion(from).Distance(Quaternion(to));
284}
285
286double dist(RotationX const &from, RotationY const &to)
287{ /*TODO*/
288 return Quaternion(from).Distance(Quaternion(to));
289}
290
291double dist(RotationX const &from, RotationZ const &to)
292{ /*TODO*/
293 return Quaternion(from).Distance(Quaternion(to));
294}
295
296// ----------------------------------------------------------------------
297// distance from RotationY
298
299double dist(RotationY const &from, Rotation3D const &to)
300{
301 return Quaternion(from).Distance(Quaternion(to));
302}
303
304double dist(RotationY const &from, AxisAngle const &to)
305{
306 return Quaternion(from).Distance(Quaternion(to));
307}
308
309double dist(RotationY const &from, EulerAngles const &to)
310{
311 return Quaternion(from).Distance(Quaternion(to));
312}
313
314double dist(RotationY const &from, Quaternion const &to)
315{
316 return Quaternion(from).Distance(to);
317}
318
319double dist(RotationY const &from, RotationZYX const &to)
320{ /*TODO better */
321 return Quaternion(from).Distance(Quaternion(to));
322}
323
324double dist(RotationY const &from, RotationX const &to)
325{ /*TODO*/
326 return Quaternion(from).Distance(Quaternion(to));
327}
328
329double dist(RotationY const &from, RotationY const &to)
330{ /*TODO*/
331 return Quaternion(from).Distance(Quaternion(to));
332}
333
334double dist(RotationY const &from, RotationZ const &to)
335{ /*TODO*/
336 return Quaternion(from).Distance(Quaternion(to));
337}
338
339// ----------------------------------------------------------------------
340// distance from RotationZ
341
342double dist(RotationZ const &from, Rotation3D const &to)
343{
344 return Quaternion(from).Distance(Quaternion(to));
345}
346
347double dist(RotationZ const &from, AxisAngle const &to)
348{
349 return Quaternion(from).Distance(Quaternion(to));
350}
351
352double dist(RotationZ const &from, EulerAngles const &to)
353{
354 return Quaternion(from).Distance(Quaternion(to));
355}
356
357double dist(RotationZ const &from, Quaternion const &to)
358{
359 return Quaternion(from).Distance(to);
360}
361
362double dist(RotationZ const &from, RotationZYX const &to)
363{ /*TODO better */
364 return Quaternion(from).Distance(Quaternion(to));
365}
366
367double dist(RotationZ const &from, RotationX const &to)
368{ /*TODO*/
369 return Quaternion(from).Distance(Quaternion(to));
370}
371
372double dist(RotationZ const &from, RotationY const &to)
373{ /*TODO*/
374 return Quaternion(from).Distance(Quaternion(to));
375}
376
377double dist(RotationZ const &from, RotationZ const &to)
378{ /*TODO*/
379 return Quaternion(from).Distance(Quaternion(to));
380}
381
382} // namespace gv_detail
383} // namespace ROOT_MATH_ARCH
384} // 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)