00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifdef GNUPRAGMA
00013 #pragma implementation
00014 #endif
00015
00016 #include "CLHEP/Vector/Rotation.h"
00017
00018 #include <cmath>
00019
00020
00021 namespace CLHEP {
00022
00023 void HepRotation::decompose(HepAxisAngle & rotation, Hep3Vector & boost)const {
00024 boost.set(0,0,0);
00025 rotation = axisAngle();
00026 }
00027
00028 void HepRotation::decompose(Hep3Vector & boost, HepAxisAngle & rotation)const {
00029 boost.set(0,0,0);
00030 rotation = axisAngle();
00031 }
00032
00033 double HepRotation::distance2( const HepRotation & r ) const {
00034 double sum = rxx * r.rxx + rxy * r.rxy + rxz * r.rxz
00035 + ryx * r.ryx + ryy * r.ryy + ryz * r.ryz
00036 + rzx * r.rzx + rzy * r.rzy + rzz * r.rzz;
00037 double answer = 3.0 - sum;
00038 return (answer >= 0 ) ? answer : 0;
00039 }
00040
00041 double HepRotation::howNear( const HepRotation & r ) const {
00042 return std::sqrt( distance2( r ) );
00043 }
00044
00045 bool HepRotation::isNear( const HepRotation & r,
00046 double epsilon) const {
00047 return distance2( r ) <= epsilon*epsilon;
00048 }
00049
00050 double HepRotation::norm2() const {
00051 double answer = 3.0 - rxx - ryy - rzz;
00052 return (answer >= 0 ) ? answer : 0;
00053 }
00054
00055 }