source: trunk/CLHEP/Vector/EulerAngles.icc@ 14

Last change on this file since 14 was 4, checked in by Pavel Demin, 16 years ago

first commit

File size: 3.5 KB
Line 
1#ifndef EULERANGLES_ICC
2#error "EulerAngles.icc included without EulerAngles.h"
3#endif
4
5
6// ----------------------------------------------------------------------
7//
8// EulerAngles.icc - Inline methods for EulerAngles class.
9//
10// History:
11// 9-Apr-1997 MF Split off from original angles.hh. Content-free.
12// 26-Jan-1998 WEB Fleshed out.
13// 12-Mar-1998 WEB Gave default constructor proper default values
14// 13-Mar-1998 WEB Simplified compare()
15// 17-Jun-1998 WEB Added namespace support
16// 27-Jul-2000 MF CLHEP version
17//
18// ----------------------------------------------------------------------
19
20namespace CLHEP {
21
22
23inline HepEulerAngles::HepEulerAngles()
24: phi_( 0.0 ), theta_( 0.0 ), psi_( 0.0 )
25{} // HepEulerAngles::HepEulerAngles()
26
27inline HepEulerAngles::HepEulerAngles (
28 double phi, double theta, double psi )
29 : phi_( phi ), theta_( theta ), psi_( psi )
30{} // HepEulerAngles::HepEulerAngles()
31
32inline double HepEulerAngles::getPhi() const {
33 return phi_;
34} // HepEulerAngles::getPhi()
35
36inline double HepEulerAngles::phi() const {
37 return phi_;
38} // HepEulerAngles::phi()
39
40inline HepEulerAngles & HepEulerAngles::setPhi( double phi ) {
41 phi_ = phi;
42 return *this;
43} // HepEulerAngles::setPhi()
44
45inline double HepEulerAngles::getTheta() const {
46 return theta_;
47} // HepEulerAngles::getTheta()
48
49inline double HepEulerAngles::theta() const {
50 return theta_;
51} // HepEulerAngles::theta()
52
53inline HepEulerAngles & HepEulerAngles::setTheta( double theta ) {
54 theta_ = theta;
55 return *this;
56} // HepEulerAngles::setTheta()
57
58inline double HepEulerAngles::getPsi() const {
59 return psi_;
60} // HepEulerAngles::getPsi()
61
62inline double HepEulerAngles::psi() const {
63 return psi_;
64} // HepEulerAngles::psi()
65
66inline HepEulerAngles & HepEulerAngles::setPsi( double psi ) {
67 psi_ = psi;
68 return *this;
69} // HepEulerAngles::setPsi()
70
71inline HepEulerAngles &
72 HepEulerAngles::set( double phi, double theta, double psi ) {
73 phi_ = phi, theta_ = theta, psi_ = psi;
74 return *this;
75} // HepEulerAngles::set()
76
77
78inline int HepEulerAngles::compare( const HepEulerAngles & ea ) const {
79
80 return phi_ < ea.phi_ ? -1
81 : phi_ > ea.phi_ ? +1
82 : theta_ < ea.theta_ ? -1
83 : theta_ > ea.theta_ ? +1
84 : psi_ < ea.psi_ ? -1
85 : psi_ > ea.psi_ ? +1
86 : 0;
87
88} // HepEulerAngles::compare()
89
90
91inline bool HepEulerAngles::operator==( const HepEulerAngles & ea ) const {
92 return ( compare( ea ) == 0 );
93} // HepEulerAngles::operator==()
94
95inline bool HepEulerAngles::operator!=( const HepEulerAngles & ea ) const {
96 return ( compare( ea ) != 0 );
97} // HepEulerAngles::operator!=()
98
99inline bool HepEulerAngles::operator<( const HepEulerAngles & ea ) const {
100 return ( compare( ea ) < 0 );
101} // HepEulerAngles::operator<()
102
103inline bool HepEulerAngles::operator<=( const HepEulerAngles & ea ) const {
104 return ( compare( ea ) <= 0 );
105} // HepEulerAngles::operator<=()
106
107inline bool HepEulerAngles::operator>( const HepEulerAngles & ea ) const {
108 return ( compare( ea ) > 0 );
109} // HepEulerAngles::operator>()
110
111inline bool HepEulerAngles::operator>=( const HepEulerAngles & ea ) const {
112 return ( compare( ea ) >= 0 );
113} // HepEulerAngles::operator>=()
114
115inline double HepEulerAngles::getTolerance() {
116 return tolerance;
117} // HepEulerAngles::getTolerance()
118
119inline double HepEulerAngles::setTolerance( double tol ) {
120 double oldTolerance( tolerance );
121 tolerance = tol;
122 return oldTolerance;
123} // HepEulerAngles::setTolerance()
124
125} // namespace CLHEP
Note: See TracBrowser for help on using the repository browser.