CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 // -*- C++ -*- 00002 // --------------------------------------------------------------------------- 00003 // 00004 // This file is a part of the CLHEP - a Class Library for High Energy Physics. 00005 // 00006 // This is the implementation of methods of the HepRotation class which 00007 // were introduced when ZOOM PhysicsVectors was merged in, other than those 00008 // involving Euler or axis/angle representations, lengthy corrections of 00009 // the rotation matrix, or I/O. 00010 // 00011 00012 #ifdef GNUPRAGMA 00013 #pragma implementation 00014 #endif 00015 00016 #include "CLHEP/Vector/defs.h" 00017 #include "CLHEP/Vector/Rotation.h" 00018 00019 #include <cmath> 00020 00021 00022 00023 namespace CLHEP { 00024 00025 void HepRotation::decompose(HepAxisAngle & rotation, Hep3Vector & boost)const { 00026 boost.set(0,0,0); 00027 rotation = axisAngle(); 00028 } 00029 00030 void HepRotation::decompose(Hep3Vector & boost, HepAxisAngle & rotation)const { 00031 boost.set(0,0,0); 00032 rotation = axisAngle(); 00033 } 00034 00035 double HepRotation::distance2( const HepRotation & r ) const { 00036 double sum = rxx * r.rxx + rxy * r.rxy + rxz * r.rxz 00037 + ryx * r.ryx + ryy * r.ryy + ryz * r.ryz 00038 + rzx * r.rzx + rzy * r.rzy + rzz * r.rzz; 00039 double answer = 3.0 - sum; 00040 return (answer >= 0 ) ? answer : 0; 00041 } 00042 00043 double HepRotation::howNear( const HepRotation & r ) const { 00044 return std::sqrt( distance2( r ) ); 00045 } 00046 00047 bool HepRotation::isNear( const HepRotation & r, 00048 double epsilon) const { 00049 return distance2( r ) <= epsilon*epsilon; 00050 } 00051 00052 double HepRotation::norm2() const { 00053 double answer = 3.0 - rxx - ryy - rzz; 00054 return (answer >= 0 ) ? answer : 0; 00055 } 00056 00057 } // namespace CLHEP