source: trunk/CLHEP/Vector/AxisAngle.h@ 6

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

first commit

File size: 2.9 KB
Line 
1#ifndef HEP_AXISANGLE_H
2#define HEP_AXISANGLE_H
3
4// ----------------------------------------------------------------------
5//
6// AxisAngle.h - provide HepAxisAngle class
7//
8// History:
9// 23-Jan-1998 WEB Initial draft
10// 15-Jun-1998 WEB Added namespace support
11// 02-May-2000 WEB No global using
12// 27-Jul-2000 MF CLHEP version
13//
14// ----------------------------------------------------------------------
15
16
17#ifndef HEP_THREEVECTOR_H
18 #include "CLHEP/Vector/ThreeVector.h"
19#endif
20
21#include <iostream>
22#include "CLHEP/Vector/defs.h"
23
24
25namespace CLHEP {
26
27
28// Declarations of classes and global methods
29class HepAxisAngle;
30std::ostream & operator<<( std::ostream & os, const HepAxisAngle & aa );
31std::istream & operator>>( std::istream & is, HepAxisAngle & aa );
32
33/**
34 * @author
35 * @ingroup vector
36 */
37class HepAxisAngle {
38
39public:
40 typedef double Scalar;
41
42protected:
43 typedef HepAxisAngle AA; // just an abbreviation
44 static Scalar tolerance; // to determine relative nearness
45
46public:
47
48 // ---------- Constructors:
49 inline HepAxisAngle();
50 inline HepAxisAngle( const Hep3Vector axis, Scalar delta );
51
52 // ---------- Destructor, copy constructor, assignment:
53 // use C++ defaults
54
55 // ---------- Accessors:
56
57public:
58 inline Hep3Vector getAxis() const;
59 inline Hep3Vector axis() const;
60 inline AA & setAxis( const Hep3Vector axis );
61
62 inline double getDelta() const;
63 inline double delta() const ;
64 inline AA & setDelta( Scalar delta );
65
66 inline AA & set( const Hep3Vector axis, Scalar delta );
67
68 // ---------- Operations:
69
70 // comparisons:
71 inline int compare ( const AA & aa ) const;
72
73 inline bool operator==( const AA & aa ) const;
74 inline bool operator!=( const AA & aa ) const;
75 inline bool operator< ( const AA & aa ) const;
76 inline bool operator<=( const AA & aa ) const;
77 inline bool operator> ( const AA & aa ) const;
78 inline bool operator>=( const AA & aa ) const;
79
80 // relative comparison:
81 inline static double getTolerance();
82 inline static double setTolerance( Scalar tol );
83
84protected:
85 double distance( const HepAxisAngle & aa ) const;
86public:
87
88 bool isNear ( const AA & aa, Scalar epsilon = tolerance ) const;
89 double howNear( const AA & aa ) const;
90
91 // ---------- I/O:
92
93 friend std::ostream & operator<<( std::ostream & os, const AA & aa );
94 friend std::istream & operator>>( std::istream & is, AA & aa );
95
96private:
97 Hep3Vector axis_; // Note: After construction, this is always of mag 1
98 double delta_;
99
100}; // HepAxisAngle
101
102
103} // namespace CLHEP
104
105
106namespace zmpv {
107
108 typedef CLHEP::HepAxisAngle AxisAngle;
109
110} // namespace zmpv
111
112
113#define AXISANGLE_ICC
114#include "CLHEP/Vector/AxisAngle.icc"
115#undef AXISANGLE_ICC
116
117#ifdef ENABLE_BACKWARDS_COMPATIBILITY
118// backwards compatibility will be enabled ONLY in CLHEP 1.9
119using namespace CLHEP;
120#endif
121
122#endif // HEP_AXISANGLE_H
Note: See TracBrowser for help on using the repository browser.