1 #ifndef SZA_UTIL_HOURANGLE_H
2 #define SZA_UTIL_HOURANGLE_H
11 #include "carma/szautil/Angle.h"
17 class HourAngle :
public Angle {
23 HourAngle() : Angle(true) {};
28 void setHours(
double hours);
29 void setHours(std::string hours);
30 void setHours(
double hour,
double min,
double sec);
40 inline double hours() {
41 return radians_ * hourPerRad_;
47 inline double seconds() {
48 return radians_ * arcSecPerRad_;
51 inline unsigned getIntegerHours() {
52 unsigned hours = (unsigned)(radians_ * hourPerRad_);
56 inline unsigned getIntegerMinutes() {
57 unsigned hours = (unsigned)(radians_ * hourPerRad_);
58 unsigned mins = (unsigned)((radians_ * hourPerRad_ - hours)*60);
63 inline unsigned getIntegerSeconds() {
64 unsigned hours = (unsigned)(radians_ * hourPerRad_);
65 unsigned mins = (unsigned)((radians_ * hourPerRad_ - hours)*60);
66 unsigned secs = (unsigned)(((radians_ * hourPerRad_ - hours)*60 - mins)*60);
70 inline unsigned getIntegerMilliSeconds() {
71 unsigned hours = (unsigned)(radians_ * hourPerRad_);
72 unsigned mins = (unsigned)((radians_ * hourPerRad_ - hours)*60);
73 unsigned secs = (unsigned)(((radians_ * hourPerRad_ - hours)*60 - mins)*60);
74 return (
unsigned)((((radians_ * hourPerRad_ - hours)*60 - mins)*60 - secs) * 1000);
80 friend std::ostream& operator<<(std::ostream& os, HourAngle& hour);
85 HourAngle operator+(HourAngle& angle);
90 HourAngle operator-(HourAngle& angle);
92 static const double hourPerRad_;
93 static const double arcSecPerRad_;
94 static const double arcSecPerSec_;
101 #endif // End #ifndef SZA_UTIL_HOURANGLE_H
Started: Wed Jan 14 11:00:24 PST 2004.