Files
2016-06-10 12:08:39 +02:00

125 lines
3.6 KiB
C++

// -*- C++ -*-
// ---------------------------------------------------------------------------
//
// This file is a part of the CLHEP - a Class Library for High Energy Physics.
//
// ----------------------------------------------------------------------
//
// EulerAngles.icc - Inline methods for EulerAngles class.
//
// History:
// 9-Apr-1997 MF Split off from original angles.hh. Content-free.
// 26-Jan-1998 WEB Fleshed out.
// 12-Mar-1998 WEB Gave default constructor proper default values
// 13-Mar-1998 WEB Simplified compare()
// 17-Jun-1998 WEB Added namespace support
// 27-Jul-2000 MF CLHEP version
//
// ----------------------------------------------------------------------
namespace CLHEP {
inline HepEulerAngles::HepEulerAngles()
: phi_( 0.0 ), theta_( 0.0 ), psi_( 0.0 )
{} // HepEulerAngles::HepEulerAngles()
inline HepEulerAngles::HepEulerAngles (
double phi1, double ttheta, double psi1 )
: phi_( phi1 ), theta_( ttheta ), psi_( psi1 )
{} // HepEulerAngles::HepEulerAngles()
inline double HepEulerAngles::getPhi() const {
return phi_;
} // HepEulerAngles::getPhi()
inline double HepEulerAngles::phi() const {
return phi_;
} // HepEulerAngles::phi()
inline HepEulerAngles & HepEulerAngles::setPhi( double phi1 ) {
phi_ = phi1;
return *this;
} // HepEulerAngles::setPhi()
inline double HepEulerAngles::getTheta() const {
return theta_;
} // HepEulerAngles::getTheta()
inline double HepEulerAngles::theta() const {
return theta_;
} // HepEulerAngles::theta()
inline HepEulerAngles & HepEulerAngles::setTheta( double ttheta ) {
theta_ = ttheta;
return *this;
} // HepEulerAngles::setTheta()
inline double HepEulerAngles::getPsi() const {
return psi_;
} // HepEulerAngles::getPsi()
inline double HepEulerAngles::psi() const {
return psi_;
} // HepEulerAngles::psi()
inline HepEulerAngles & HepEulerAngles::setPsi( double psi1 ) {
psi_ = psi1;
return *this;
} // HepEulerAngles::setPsi()
inline HepEulerAngles &
HepEulerAngles::set( double phi1, double ttheta, double psi1 ) {
phi_ = phi1, theta_ = ttheta, psi_ = psi1;
return *this;
} // HepEulerAngles::set()
inline int HepEulerAngles::compare( const HepEulerAngles & ea ) const {
return phi_ < ea.phi_ ? -1
: phi_ > ea.phi_ ? +1
: theta_ < ea.theta_ ? -1
: theta_ > ea.theta_ ? +1
: psi_ < ea.psi_ ? -1
: psi_ > ea.psi_ ? +1
: 0;
} // HepEulerAngles::compare()
inline bool HepEulerAngles::operator==( const HepEulerAngles & ea ) const {
return ( compare( ea ) == 0 );
} // HepEulerAngles::operator==()
inline bool HepEulerAngles::operator!=( const HepEulerAngles & ea ) const {
return ( compare( ea ) != 0 );
} // HepEulerAngles::operator!=()
inline bool HepEulerAngles::operator<( const HepEulerAngles & ea ) const {
return ( compare( ea ) < 0 );
} // HepEulerAngles::operator<()
inline bool HepEulerAngles::operator<=( const HepEulerAngles & ea ) const {
return ( compare( ea ) <= 0 );
} // HepEulerAngles::operator<=()
inline bool HepEulerAngles::operator>( const HepEulerAngles & ea ) const {
return ( compare( ea ) > 0 );
} // HepEulerAngles::operator>()
inline bool HepEulerAngles::operator>=( const HepEulerAngles & ea ) const {
return ( compare( ea ) >= 0 );
} // HepEulerAngles::operator>=()
inline double HepEulerAngles::getTolerance() {
return tolerance;
} // HepEulerAngles::getTolerance()
inline double HepEulerAngles::setTolerance( double tol ) {
double oldTolerance( tolerance );
tolerance = tol;
return oldTolerance;
} // HepEulerAngles::setTolerance()
} // namespace CLHEP