14 #ifndef CARMA_SERVICES_ANGLE_H
15 #define CARMA_SERVICES_ANGLE_H
52 explicit Angle(
double value,
const std::string& units);
65 double radians(
bool modulo =
true)
const;
75 double hours(
bool modulo =
true)
const;
85 double degrees(
bool modulo =
false)
const;
117 std::string
dms(
bool modulo =
true,
int precision = 0)
const;
126 reset(radians,
"radians");
206 static inline std::string
getString(
double angle,
int precision=0)
208 return getAngleString(angle, precision,
true,
true);
227 static std::string getAngleString(
double a,
230 bool useSign =
false);
269 const Angle moduloTwoPi(
double value)
const;
274 double moduloTwoPiDouble(
double value)
const;
285 const Angle operator*(
double left,
const Angle & right );
286 const Angle operator*(
const Angle & left,
double right );
291 #endif //CARMA_SERVICES_ANGLE_H
std::string dms(bool modulo=true, int precision=0) const
Angle & operator+=(const Angle &angle)
Add Angle.
const Angle operator-(const Angle &angle) const
Subtract two Angles.
bool operator<(const Angle &right) const
Less than comparison.
static std::string getString(double angle, int precision=0)
Return a zero filled string +/-ddd:mm:ss.s.
static const std::string RADIANS_STR
A const string that may be used for unit conversion.
double degrees(bool modulo=false) const
Convenience method that returns the value of this angle in degrees.
double arcMinutes(bool modulo=false) const
Convenience method that returns the value of this angle in arcminutes.
static const std::string ARCMIN_STR
A const string that may be used for unit conversion.
friend const Angle operator*(double left, const Angle &right)
Multiply an angle by a scalar.
bool operator<=(const Angle &right) const
Less than or equal comparison.
const Angle operator/(double scalar) const
Divide an angle by a scalar.
Angle & operator/=(double scalar)
Divide by a scalar.
void setRadians(double radians)
Set the value of this angle in radians.
Angle & operator-=(const Angle &angle)
Subtract Angle.
static const double twoPi_
Two pi.
const Angle operator+(const Angle &angle) const
Add two Angles.
Angle()
Default constructor.
static const std::string ARCSEC_STR
A const string that may be used for unit conversion.
The Angle class can represent any angle in any units.
Angle & operator*=(double scalar)
Multiply an angle by a scalar.
double arcSeconds(bool modulo=false) const
Convenience method that returns the value of this angle in arcseconds.
static const std::string DEGREES_STR
A const string that may be used for unit conversion.
static const std::string HOURS_STR
A const string that may be used for unit conversion.
std::ostream & operator<<(std::ostream &os, const carma::services::Angle &angle)
Define the << operator to allow, e.g.
virtual ~Angle()
Destructor.
bool operator>(const Angle &right) const
Greater than comparison.
double hours(bool modulo=true) const
Convenience method that returns the value of this angle in hours.
double radians(bool modulo=true) const
Convenience method that returns the value of this angle in radians.
bool operator>=(const Angle &right) const
Greater than or equal comparison.