Home
Install
Use
Develop
Support
News
Credits
hosted by
|
22 static const double MilliSecin12Hours = 4.32e7;
24 #define ANGLE_STRLEN 128
36 void init() {radians=0.0;wrap_point=M_PI;}
41 enum Type { Degrees, Radians, Turns };
43 static Type default_type;
46 {init(); radians=a.radians;wrap_point=a.wrap_point;}
47 Angle ( const double& rad = 0);
51 void setWrapPoint( double wp){wrap_point=wp; wrap();}
52 double getWrapPoint() { return wrap_point;}
57 void setHMS ( int hours, int minutes, double seconds);
58 void getHMS ( int& hours, int& minutes, double& seconds) const;
60 int setHMS ( const char *);
64 char* getHMS ( char* str, int places=3) const;
67 std::string getHMS ( int places = 3) const;
69 void setDMS ( int degrees, int minutes, double seconds);
70 void getDMS ( int& degrees, int& minutes, double& seconds) const;
72 int setDMS ( const char *);
76 char* getDMS ( char* str, int places=3) const;
79 std::string getDMS ( int places = 3) const;
82 void setRadMS( long int ms)
83 { radians = double(ms) * M_PI / MilliSecin12Hours; };
85 { return long(radians * MilliSecin12Hours / M_PI); };
87 void setDegrees( double deg)
88 { radians = deg * M_PI/180.0; wrap();};
90 double getDegrees() const
91 { return radians * 180.0/M_PI; };
93 void setTurns( double turns)
94 { radians = turns * 2.0*M_PI; wrap();};
96 double getTurns() const
97 { return radians / (2.0*M_PI); };
99 void setRadians( double rad)
100 { radians = rad; wrap(); };
102 double getRadians() const
105 void setDegMS ( double deg_mmss);
106 double getDegMS () const;
108 void setHourMS ( double hour_mmss);
109 double getHourMS () const;
111 void setTurnMS ( double turn_mmss);
112 double getTurnMS () const;
115 Angle & operator= ( const double &val);
119 Angle & operator+= ( const double & d);
120 Angle & operator-= ( const double & d);
121 Angle & operator*= ( const double & d);
122 Angle & operator/= ( const double & d);
125 friend const Angle operator + ( const Angle &, double);
126 friend const Angle operator - ( const Angle &, double);
127 friend const Angle operator / ( const Angle &, double);
128 friend const Angle operator * ( const Angle &, double);
129 friend const Angle operator - ( const Angle &);
131 friend double operator * ( const Angle &, const Angle &);
133 friend int operator > ( const Angle &, const Angle &);
134 friend int operator < ( const Angle &, const Angle &);
135 friend int operator >= ( const Angle &, const Angle &);
136 friend int operator <= ( const Angle &, const Angle &);
137 friend int operator == ( const Angle &, const Angle &);
138 friend int operator != ( const Angle &, const Angle &);
140 inline friend double cast_double( const Angle &a) { return a.radians;}
143 std::ostream& operator << (std::ostream& os, const Angle& angle);
144 std::istream& operator >> (std::istream& is, Angle& angle);
150 class numeric_limits< Angle> : public numeric_limits<double> {
168 Angle angle1, angle2;
171 int setHMSDMS ( const char* coordstr);
174 int setHMSDMS ( const char *, const char *);
175 int setHMSDMS ( const std::string&, const std::string&);
176 void getHMSDMS ( char* s1, char* s2, int places1=3, int places2=2) const;
177 std::string getHMSDMS ( int places1 = 3, int places2 = 2, bool space = true) const;
179 void setDegrees ( double, double);
180 void getDegrees ( double *, double *) const;
181 std::string getDegrees () const;
182 void setRadians ( double, double);
183 void getRadians ( double *, double *) const;
184 std::string getRadians () const;
190 void setRadMS( long int , long int );
191 void getRadMS( long int*, long int*);
197 AnglePair ( const double = 0.0, const double = 0.0);
210 friend std::ostream& operator<< (std::ostream&, const AnglePair&);
215 double sin( const Angle&);
216 double cos( const Angle&);
217 double tan( const Angle&);
220 Angle arctan( double);
221 Angle arctan( double y, double x);
A convenient exception handling class. Definition: Error.h:54
AnglePair class : useful for sky positions. Definition: Angle.h:165
Class for dealing with angular info. Definition: Angle.h:27
Generated using doxygen 1.8.17
|