3DDistances.cxx

Go to the documentation of this file.
00001 // @(#)root/mathcore:$Id: 3DDistances.cxx 22516 2008-03-07 15:14:26Z moneta $
00002 // Authors: W. Brown, M. Fischler, L. Moneta    2005  
00003 
00004  /**********************************************************************
00005   *                                                                    *
00006   * Copyright (c) 2005, LCG ROOT FNAL MathLib Team                    *
00007   *                                                                    *
00008   *                                                                    *
00009   **********************************************************************/
00010 
00011 // Source file for something else
00012 //
00013 // Created by: Mark Fischler Thurs July 7, 2005
00014 //
00015 // Last update: Wed Thurs July 7, 2005
00016 //
00017 
00018 
00019 #include "Math/GenVector/3DDistances.h"
00020 
00021 #include "Math/GenVector/Rotation3D.h"
00022 #include "Math/GenVector/AxisAngle.h"
00023 #include "Math/GenVector/EulerAngles.h"
00024 #include "Math/GenVector/Quaternion.h"
00025 #include "Math/GenVector/RotationZYX.h"
00026 #include "Math/GenVector/RotationX.h"
00027 #include "Math/GenVector/RotationY.h"
00028 #include "Math/GenVector/RotationZ.h"
00029 
00030 #include <cmath>
00031 
00032 
00033 namespace ROOT {
00034 namespace Math {
00035 namespace gv_detail {
00036 
00037 
00038 enum ERotation3DMatrixIndex
00039 { kXX = 0, kXY = 1, kXZ = 2
00040 , kYX = 3, kYY = 4, kYZ = 5
00041 , kZX = 6, kZY = 7, kZZ = 8
00042 };
00043 
00044 
00045 // ----------------------------------------------------------------------
00046 // distance from Rotation3D
00047 
00048 double dist( Rotation3D const & from, Rotation3D const & to)
00049 { /*TODO better */
00050    return Quaternion(from).Distance(Quaternion(to));
00051 }
00052 
00053 double dist( Rotation3D const & from, AxisAngle const & to)
00054 {  return Quaternion(from).Distance(Quaternion(to));}
00055 
00056 double dist( Rotation3D const & from, EulerAngles const & to)
00057 {  return Quaternion(from).Distance(Quaternion(to)); }
00058 
00059 double dist( Rotation3D const & from, Quaternion const & to)
00060 {  return Quaternion(from).Distance(to); }
00061 
00062 double dist( Rotation3D const & from, RotationZYX const & to)
00063 { /*TODO better */
00064    return Quaternion(from).Distance(Quaternion(to));
00065 }
00066 double dist( Rotation3D const & from, RotationX const & to)
00067 { /*TODO better */
00068    return Quaternion(from).Distance(Quaternion(to));
00069 }
00070 
00071 double dist( Rotation3D const & from, RotationY const & to)
00072 { /*TODO*/ 
00073    return Quaternion(from).Distance(Quaternion(to));
00074 }
00075 
00076 double dist( Rotation3D const & from, RotationZ const & to)
00077 { /*TODO*/ 
00078    return Quaternion(from).Distance(Quaternion(to));
00079 }
00080 
00081 
00082 
00083 // ----------------------------------------------------------------------
00084 // distance from AxisAngle
00085 
00086 double dist( AxisAngle const & from, Rotation3D const & to)
00087 {  return Quaternion(from).Distance(Quaternion(to)); }
00088 
00089 double dist( AxisAngle const & from, AxisAngle const & to)
00090 { /*TODO*/ 
00091    return Quaternion(from).Distance(Quaternion(to));
00092 }
00093 
00094 double dist( AxisAngle const & from, EulerAngles const & to)
00095 {  return Quaternion(from).Distance(Quaternion(to)); }
00096 
00097 double dist( AxisAngle const & from, Quaternion const & to)
00098 {  return Quaternion(from).Distance(to); }
00099 
00100 double dist( AxisAngle const & from, RotationZYX const & to)
00101 { /*TODO better */
00102    return Quaternion(from).Distance(Quaternion(to));
00103 }
00104 
00105 double dist( AxisAngle const & from, RotationX const & to)
00106 { /*TODO*/ 
00107    return Quaternion(from).Distance(Quaternion(to));
00108 }
00109 
00110 double dist( AxisAngle const & from, RotationY const & to)
00111 { /*TODO*/ 
00112    return Quaternion(from).Distance(Quaternion(to));
00113 }
00114 
00115 double dist( AxisAngle const & from, RotationZ const & to)
00116 { /*TODO*/ 
00117    return Quaternion(from).Distance(Quaternion(to));
00118 }
00119 
00120 
00121 
00122 // ----------------------------------------------------------------------
00123 // distance from EulerAngles
00124 
00125 double dist( EulerAngles const & from, Rotation3D const & to)
00126 {  return Quaternion(from).Distance(Quaternion(to)); }
00127 
00128 double dist( EulerAngles const & from, AxisAngle const & to)
00129 {  return Quaternion(from).Distance(Quaternion(to)); }
00130 
00131 double dist( EulerAngles const & from, EulerAngles const & to)
00132 { /*TODO*/ 
00133    return Quaternion(from).Distance(Quaternion(to));
00134 }
00135 
00136 double dist( EulerAngles const & from, Quaternion const & to)
00137 {  return Quaternion(from).Distance(to); }
00138 
00139 double dist( EulerAngles const & from, RotationZYX const & to)
00140 { /*TODO better */
00141    return Quaternion(from).Distance(Quaternion(to));
00142 }
00143 
00144 double dist( EulerAngles const & from, RotationX const & to)
00145 { /*TODO*/ 
00146    return Quaternion(from).Distance(Quaternion(to));
00147 }
00148 
00149 double dist( EulerAngles const & from, RotationY const & to)
00150 { /*TODO*/ 
00151    return Quaternion(from).Distance(Quaternion(to));
00152 }
00153 
00154 double dist( EulerAngles const & from, RotationZ const & to)
00155 { /*TODO*/ 
00156    return Quaternion(from).Distance(Quaternion(to));
00157 }
00158 
00159 
00160 
00161 // ----------------------------------------------------------------------
00162 // distance from Quaternion
00163 
00164 double dist( Quaternion const & from, Rotation3D const & to)
00165 {  return from.Distance(Quaternion(to)); }
00166 
00167 double dist( Quaternion const & from, AxisAngle const & to)
00168 {  return from.Distance(Quaternion(to)); }
00169 
00170 double dist( Quaternion const & from, EulerAngles const & to)
00171 {  return from.Distance(Quaternion(to)); }
00172 
00173 double dist( Quaternion const & from, Quaternion const & to)
00174 {  return from.Distance(to); }
00175 
00176 double dist( Quaternion const & from, RotationZYX const & to)
00177 {  return from.Distance(Quaternion(to)); }
00178 
00179 double dist( Quaternion const & from, RotationX const & to)
00180 { /*TODO*/ 
00181    return from.Distance(Quaternion(to)); 
00182 }
00183 
00184 double dist( Quaternion const & from, RotationY const & to)
00185 { /*TODO*/ 
00186    return from.Distance(Quaternion(to)); 
00187 }
00188 
00189 double dist( Quaternion const & from, RotationZ const & to)
00190 { /*TODO*/ 
00191    return from.Distance(Quaternion(to)); 
00192 }
00193 
00194 // ----------------------------------------------------------------------
00195 // distance from RotationZYX
00196 
00197 double dist( RotationZYX const & from, Rotation3D const & to)
00198 {  return Quaternion(from).Distance(Quaternion(to)); }
00199 
00200 double dist( RotationZYX const & from, AxisAngle const & to)
00201 {  return Quaternion(from).Distance(Quaternion(to)); }
00202 
00203 double dist( RotationZYX const & from, EulerAngles const & to)
00204 {  return Quaternion(from).Distance(Quaternion(to)); }
00205 
00206 double dist( RotationZYX const & from, Quaternion const & to)
00207 {  return Quaternion(from).Distance(to); }
00208 
00209 double dist( RotationZYX const & from, RotationZYX const & to)
00210 { /*TODO better */
00211    return Quaternion(from).Distance(Quaternion(to));
00212 }
00213 
00214 double dist( RotationZYX const & from, RotationX const & to)
00215 { /*TODO*/ 
00216    return Quaternion(from).Distance(Quaternion(to));
00217 }
00218 
00219 double dist( RotationZYX const & from, RotationY const & to)
00220 { /*TODO*/ 
00221    return Quaternion(from).Distance(Quaternion(to));
00222 }
00223 
00224 double dist( RotationZYX const & from, RotationZ const & to)
00225 { /*TODO*/ 
00226    return Quaternion(from).Distance(Quaternion(to));
00227 }
00228 
00229 
00230 
00231 // ----------------------------------------------------------------------
00232 // distance from RotationX
00233 
00234 double dist( RotationX const & from, Rotation3D const & to)
00235 {  return Quaternion(from).Distance(Quaternion(to)); }
00236 
00237 double dist( RotationX const & from, AxisAngle const & to)
00238 {  return Quaternion(from).Distance(Quaternion(to)); }
00239 
00240 double dist( RotationX const & from, EulerAngles const & to)
00241 {  return Quaternion(from).Distance(Quaternion(to)); }
00242 
00243 double dist( RotationX const & from, Quaternion const & to)
00244 {  return Quaternion(from).Distance(to); }
00245 
00246 double dist( RotationX const & from, RotationZYX const & to)
00247 { /*TODO better */
00248    return Quaternion(from).Distance(Quaternion(to));
00249 }
00250 
00251 double dist( RotationX const & from, RotationX const & to)
00252 { /*TODO*/ 
00253    return Quaternion(from).Distance(Quaternion(to));
00254 }
00255 
00256 double dist( RotationX const & from, RotationY const & to)
00257 { /*TODO*/ 
00258    return Quaternion(from).Distance(Quaternion(to));
00259 }
00260 
00261 double dist( RotationX const & from, RotationZ const & to)
00262 { /*TODO*/ 
00263    return Quaternion(from).Distance(Quaternion(to));
00264 }
00265 
00266 
00267 
00268 // ----------------------------------------------------------------------
00269 // distance from RotationY
00270 
00271 double dist( RotationY const & from, Rotation3D const & to)
00272 {  return Quaternion(from).Distance(Quaternion(to)); }
00273 
00274 double dist( RotationY const & from, AxisAngle const & to)
00275 {  return Quaternion(from).Distance(Quaternion(to)); }
00276 
00277 double dist( RotationY const & from, EulerAngles const & to)
00278 {  return Quaternion(from).Distance(Quaternion(to)); }
00279 
00280 double dist( RotationY const & from, Quaternion const & to)
00281 {  return Quaternion(from).Distance(to); }
00282 
00283 double dist( RotationY const & from, RotationZYX const & to)
00284 { /*TODO better */
00285    return Quaternion(from).Distance(Quaternion(to));
00286 }
00287 
00288 double dist( RotationY const & from, RotationX const & to)
00289 { /*TODO*/ 
00290    return Quaternion(from).Distance(Quaternion(to));
00291 }
00292 
00293 double dist( RotationY const & from, RotationY const & to)
00294 { /*TODO*/ 
00295    return Quaternion(from).Distance(Quaternion(to));
00296 }
00297 
00298 double dist( RotationY const & from, RotationZ const & to)
00299 { /*TODO*/ 
00300    return Quaternion(from).Distance(Quaternion(to));
00301 }
00302 
00303 
00304 
00305 // ----------------------------------------------------------------------
00306 // distance from RotationZ
00307 
00308 double dist( RotationZ const & from, Rotation3D const & to)
00309 {  return Quaternion(from).Distance(Quaternion(to)); }
00310 
00311 double dist( RotationZ const & from, AxisAngle const & to)
00312 {  return Quaternion(from).Distance(Quaternion(to)); }
00313 
00314 double dist( RotationZ const & from, EulerAngles const & to)
00315 {  return Quaternion(from).Distance(Quaternion(to)); }
00316 
00317 double dist( RotationZ const & from, Quaternion const & to)
00318 {  return Quaternion(from).Distance(to); }
00319 
00320 double dist( RotationZ const & from, RotationZYX const & to)
00321 { /*TODO better */
00322    return Quaternion(from).Distance(Quaternion(to));
00323 }
00324 
00325 double dist( RotationZ const & from, RotationX const & to)
00326 { /*TODO*/ 
00327    return Quaternion(from).Distance(Quaternion(to));
00328 }
00329 
00330 double dist( RotationZ const & from, RotationY const & to)
00331 { /*TODO*/ 
00332    return Quaternion(from).Distance(Quaternion(to));
00333 }
00334 
00335 double dist( RotationZ const & from, RotationZ const & to)
00336 { /*TODO*/ 
00337    return Quaternion(from).Distance(Quaternion(to));
00338 }
00339 
00340 
00341 } //namespace gv_detail
00342 } //namespace Math
00343 } //namespace ROOT

Generated on Tue Jul 5 14:30:52 2011 for ROOT_528-00b_version by  doxygen 1.5.1