[4] | 1 | #ifndef AXISANGLE_ICC
|
---|
| 2 | #error "AxisAngle.icc included without AxisAngle.h"
|
---|
| 3 | #endif
|
---|
| 4 |
|
---|
| 5 |
|
---|
| 6 | // ----------------------------------------------------------------------
|
---|
| 7 | //
|
---|
| 8 | // AxisAngle.icc
|
---|
| 9 | //
|
---|
| 10 | // History:
|
---|
| 11 | // 23-Jan-1998 WEB Initial draft
|
---|
| 12 | // 12-Mar-1998 WEB Gave default constructor proper default values
|
---|
| 13 | // 13-Mar-1998 WEB Corrected setDelta; simplified compare()
|
---|
| 14 | // 17-Jun-1998 WEB Added namespace support
|
---|
| 15 | // 26-Jul-2000 MF CLHEP version
|
---|
| 16 | //
|
---|
| 17 | // ----------------------------------------------------------------------
|
---|
| 18 |
|
---|
| 19 | namespace CLHEP {
|
---|
| 20 |
|
---|
| 21 | inline HepAxisAngle::HepAxisAngle() :
|
---|
| 22 | axis_( Hep3Vector(0,0,1) ), delta_( 0.0 )
|
---|
| 23 | {} // HepAxisAngle::HepAxisAngle()
|
---|
| 24 |
|
---|
| 25 | inline HepAxisAngle::HepAxisAngle( const Hep3Vector axis, Scalar delta ) :
|
---|
| 26 | axis_( axis.unit() ), delta_( delta )
|
---|
| 27 | {} // HepAxisAngle::HepAxisAngle()
|
---|
| 28 |
|
---|
| 29 |
|
---|
| 30 | inline Hep3Vector HepAxisAngle::getAxis() const {
|
---|
| 31 | return axis_;
|
---|
| 32 | } // HepAxisAngle::getAxis()
|
---|
| 33 |
|
---|
| 34 | inline Hep3Vector HepAxisAngle::axis() const {
|
---|
| 35 | return axis_;
|
---|
| 36 | } // HepAxisAngle::axis()
|
---|
| 37 |
|
---|
| 38 |
|
---|
| 39 | inline HepAxisAngle & HepAxisAngle::setAxis( const Hep3Vector axis ) {
|
---|
| 40 | axis_ = axis.unit();
|
---|
| 41 | return *this;
|
---|
| 42 | } // HepAxisAngle::setAxis()
|
---|
| 43 |
|
---|
| 44 |
|
---|
| 45 | inline double HepAxisAngle::getDelta() const {
|
---|
| 46 | return delta_;
|
---|
| 47 | } // HepAxisAngle::getDelta()
|
---|
| 48 |
|
---|
| 49 | inline double HepAxisAngle::delta() const {
|
---|
| 50 | return delta_;
|
---|
| 51 | } // HepAxisAngle::delta()
|
---|
| 52 |
|
---|
| 53 |
|
---|
| 54 | inline HepAxisAngle & HepAxisAngle::setDelta( Scalar delta ) {
|
---|
| 55 | delta_ = delta;
|
---|
| 56 | return *this;
|
---|
| 57 | } // HepAxisAngle::setDelta()
|
---|
| 58 |
|
---|
| 59 |
|
---|
| 60 | inline HepAxisAngle & HepAxisAngle::set( const Hep3Vector axis, Scalar delta ) {
|
---|
| 61 | axis_ = axis.unit();
|
---|
| 62 | delta_ = delta;
|
---|
| 63 | return *this;
|
---|
| 64 | } // HepAxisAngle::set()
|
---|
| 65 |
|
---|
| 66 |
|
---|
| 67 | inline int HepAxisAngle::compare( const AA & aa ) const {
|
---|
| 68 |
|
---|
| 69 | return delta_ < aa.delta_ ? -1
|
---|
| 70 | : delta_ > aa.delta_ ? +1
|
---|
| 71 | : axis_ < aa.axis_ ? -1
|
---|
| 72 | : axis_ > aa.axis_ ? +1
|
---|
| 73 | : 0;
|
---|
| 74 |
|
---|
| 75 | } // HepAxisAngle::compare()
|
---|
| 76 |
|
---|
| 77 |
|
---|
| 78 | inline bool HepAxisAngle::operator==( const AA & aa ) const {
|
---|
| 79 | return ( compare( aa ) == 0 );
|
---|
| 80 | } // HepAxisAngle::operator==()
|
---|
| 81 |
|
---|
| 82 |
|
---|
| 83 | inline bool HepAxisAngle::operator!=( const AA & aa ) const {
|
---|
| 84 | return ( compare( aa ) != 0 );
|
---|
| 85 | } // HepAxisAngle::operator!=()
|
---|
| 86 |
|
---|
| 87 |
|
---|
| 88 | inline bool HepAxisAngle::operator<( const AA & aa ) const {
|
---|
| 89 | return ( compare( aa ) < 0 );
|
---|
| 90 | } // HepAxisAngle::operator<()
|
---|
| 91 |
|
---|
| 92 |
|
---|
| 93 | inline bool HepAxisAngle::operator<=( const AA & aa ) const {
|
---|
| 94 | return ( compare( aa ) <= 0 );
|
---|
| 95 | } // HepAxisAngle::operator<=()
|
---|
| 96 |
|
---|
| 97 |
|
---|
| 98 | inline bool HepAxisAngle::operator>( const AA & aa ) const {
|
---|
| 99 | return ( compare( aa ) > 0 );
|
---|
| 100 | } // HepAxisAngle::operator>()
|
---|
| 101 |
|
---|
| 102 |
|
---|
| 103 | inline bool HepAxisAngle::operator>=( const AA & aa ) const {
|
---|
| 104 | return ( compare( aa ) >= 0 );
|
---|
| 105 | } // HepAxisAngle::operator>=()
|
---|
| 106 |
|
---|
| 107 |
|
---|
| 108 | inline double HepAxisAngle::getTolerance() {
|
---|
| 109 | return tolerance;
|
---|
| 110 | } // HepAxisAngle::getTolerance()
|
---|
| 111 |
|
---|
| 112 |
|
---|
| 113 | inline double HepAxisAngle::setTolerance( Scalar tol ) {
|
---|
| 114 | Scalar oldTolerance( tolerance );
|
---|
| 115 | tolerance = tol;
|
---|
| 116 | return oldTolerance;
|
---|
| 117 | } // HepAxisAngle::setTolerance()
|
---|
| 118 |
|
---|
| 119 | } // namespace CLHEP
|
---|