CLHEP/Vector/AxisAngle.h

00001 #ifndef HEP_AXISANGLE_H
00002 #define HEP_AXISANGLE_H
00003 
00004 // ----------------------------------------------------------------------
00005 //
00006 // AxisAngle.h - provide HepAxisAngle class
00007 //
00008 // History:
00009 //   23-Jan-1998  WEB  Initial draft
00010 //   15-Jun-1998  WEB  Added namespace support
00011 //   02-May-2000  WEB  No global using
00012 //   27-Jul-2000  MF   CLHEP version
00013 //
00014 // ----------------------------------------------------------------------
00015 
00016 
00017 #ifndef HEP_THREEVECTOR_H
00018   #include "CLHEP/Vector/ThreeVector.h"
00019 #endif
00020 
00021 // Declarations of classes and global methods
00022 class HepAxisAngle;
00023 HepStd::ostream & operator<<( HepStd::ostream & os, const HepAxisAngle & aa );
00024 HepStd::istream & operator>>( HepStd::istream & is,       HepAxisAngle & aa );
00025 
00030 class HepAxisAngle {
00031 
00032 public:
00033   typedef double Scalar;
00034 
00035 protected:
00036   typedef HepAxisAngle AA;         // just an abbreviation
00037   static Scalar tolerance;      // to determine relative nearness
00038 
00039 public:
00040 
00041   // ----------  Constructors:
00042   inline HepAxisAngle();
00043   inline HepAxisAngle( const Hep3Vector axis, Scalar delta );
00044 
00045   // ----------  Destructor, copy constructor, assignment:
00046   // use C++ defaults
00047 
00048   // ----------  Accessors:
00049 
00050 public:
00051   inline Hep3Vector            getAxis() const;
00052   inline Hep3Vector            axis() const;
00053   inline AA &                  setAxis( const Hep3Vector axis );
00054 
00055   inline double             getDelta() const;
00056   inline double             delta() const ;
00057   inline AA &                  setDelta( Scalar delta );
00058 
00059   inline AA & set( const Hep3Vector axis, Scalar delta );
00060 
00061   // ----------  Operations:
00062 
00063   //   comparisons:
00064   inline int  compare   ( const AA & aa ) const;
00065 
00066   inline bool operator==( const AA & aa ) const;
00067   inline bool operator!=( const AA & aa ) const;
00068   inline bool operator< ( const AA & aa ) const;
00069   inline bool operator<=( const AA & aa ) const;
00070   inline bool operator> ( const AA & aa ) const;
00071   inline bool operator>=( const AA & aa ) const;
00072 
00073   //   relative comparison:
00074   inline static double getTolerance();
00075   inline static double setTolerance( Scalar tol );
00076 
00077 protected:
00078     double distance( const HepAxisAngle & aa ) const;
00079 public:
00080 
00081   bool isNear ( const AA & aa, Scalar epsilon = tolerance ) const;
00082   double  howNear( const AA & aa ) const;
00083 
00084   // ----------  I/O:
00085 
00086   friend HepStd::ostream & operator<<( HepStd::ostream & os, const AA & aa );
00087   friend HepStd::istream & operator>>( HepStd::istream & is,       AA & aa );
00088 
00089 private:
00090   Hep3Vector axis_;  // Note:  After construction, this is always of mag 1
00091   double  delta_;
00092 
00093 };  // HepAxisAngle
00094 
00095 namespace zmpv  {
00096 
00097   typedef HepAxisAngle AxisAngle;
00098 
00099 }  // end of namespace zmpv  
00100 
00101 #define AXISANGLE_ICC
00102 #include "CLHEP/Vector/AxisAngle.icc"
00103 #undef AXISANGLE_ICC
00104 
00105 #endif  // HEP_AXISANGLE_H

Class Library for High Energy Physics (version 1.8)