|
CARMA C++
|
The HourAngle class extends carma::services::Angle to specifically support hour angles. More...
#include <carma/services/HourAngle.h>
Public Member Functions | |
| double | convert (const std::string &convertTo) const |
| Converts this quantity to any conformable units. More... | |
| std::string | getLstString (int precision=0) |
| Return LST for HourAngle value in +/-hh:mm:ss.s format. More... | |
| std::string | getString (int precision=0) |
| Return the HourAngle value as a string in +/-hh:mm:ss.s format. More... | |
| std::string | getUnits () const |
| HourAngle (double value, const std::string &units) | |
| Construct an HourAngle given a value and units. More... | |
| double | hours () const |
| Convenience method that returns the value of this angle in hours. More... | |
| const HourAngle | operator+ (const HourAngle &angle) const |
| Add two HourAngles. More... | |
| HourAngle & | operator+= (const HourAngle &frequency) |
| Increment HourAngle. More... | |
| const HourAngle | operator- (const HourAngle &angle) const |
| Subtract two HourAngles. More... | |
| HourAngle & | operator-= (const HourAngle &frequency) |
| Decrement HourAngle. More... | |
| void | reset (double value, const std::string &units) |
| Reset method to change value and/or units. More... | |
| virtual | ~HourAngle () |
| Destructor. More... | |
Public Member Functions inherited from carma::services::Angle | |
| Angle () | |
| Default constructor. More... | |
| Angle (double value, const std::string &units) | |
| Construct an Angle given a value and units. More... | |
| double | arcMinutes (bool modulo=false) const |
| Convenience method that returns the value of this angle in arcminutes. More... | |
| double | arcSeconds (bool modulo=false) const |
| Convenience method that returns the value of this angle in arcseconds. More... | |
| double | degrees (bool modulo=false) const |
| Convenience method that returns the value of this angle in degrees. More... | |
| std::string | dms (bool modulo=true, int precision=0) const |
| double | hours (bool modulo=true) const |
| Convenience method that returns the value of this angle in hours. More... | |
| Angle & | operator*= (double scalar) |
| Multiply an angle by a scalar. More... | |
| const Angle | operator+ (const Angle &angle) const |
| Add two Angles. More... | |
| Angle & | operator+= (const Angle &angle) |
| Add Angle. More... | |
| const Angle | operator- (const Angle &angle) const |
| Subtract two Angles. More... | |
| Angle & | operator-= (const Angle &angle) |
| Subtract Angle. More... | |
| const Angle | operator/ (double scalar) const |
| Divide an angle by a scalar. More... | |
| Angle & | operator/= (double scalar) |
| Divide by a scalar. More... | |
| bool | operator< (const Angle &right) const |
| Less than comparison. More... | |
| bool | operator<= (const Angle &right) const |
| Less than or equal comparison. More... | |
| bool | operator> (const Angle &right) const |
| Greater than comparison. More... | |
| bool | operator>= (const Angle &right) const |
| Greater than or equal comparison. More... | |
| double | radians (bool modulo=true) const |
| Convenience method that returns the value of this angle in radians. More... | |
| void | setRadians (double radians) |
| Set the value of this angle in radians. More... | |
| virtual | ~Angle () |
| Destructor. More... | |
Public Member Functions inherited from carma::services::ConformableQuantity | |
| ConformableQuantity (double value, const std::string &units) | |
| Construct an ConformableQuantity given a value and units. More... | |
| double | getValue () const |
| virtual const ConformableQuantity | operator+ (const ConformableQuantity &quantity) const |
| Add two ConformableQuantities. More... | |
| virtual ConformableQuantity & | operator+= (const ConformableQuantity &quantity) |
| Add ConformableQuantity to itself. More... | |
| virtual const ConformableQuantity | operator- (const ConformableQuantity &quantity) const |
| Subtract two ConformableQuantities. More... | |
| virtual ConformableQuantity & | operator-= (const ConformableQuantity &quantity) |
| Subtract ConformableQuantity from itself. More... | |
| virtual | ~ConformableQuantity () |
| Destructor. More... | |
Static Public Member Functions | |
| static std::string | getAngleString (double angle, int precision=0) |
| return angle in a +/-hh:mm:ss.s format More... | |
| static std::string | hms (double decimalHours, int precision) |
Static Public Member Functions inherited from carma::services::Angle | |
| static std::string | getString (double angle, int precision=0) |
| Return a zero filled string +/-ddd:mm:ss.s. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from carma::services::Angle | |
| static const std::string | ARCMIN_STR |
| A const string that may be used for unit conversion. More... | |
| static const std::string | ARCSEC_STR |
| A const string that may be used for unit conversion. More... | |
| static const std::string | DEGREES_STR |
| A const string that may be used for unit conversion. More... | |
| static const std::string | HOURS_STR |
| A const string that may be used for unit conversion. More... | |
| static const std::string | RADIANS_STR |
| A const string that may be used for unit conversion. More... | |
Static Protected Member Functions inherited from carma::services::Angle | |
| static std::string | getAngleString (double a, int precision=0, bool dms=true, bool useSign=false) |
Protected Attributes inherited from carma::services::ConformableQuantity | |
| Units | u_ |
| Used for converting between units. More... | |
Static Protected Attributes inherited from carma::services::Angle | |
| static const double | twoPi_ = 2 * M_PIl |
| Two pi. More... | |
The HourAngle class extends carma::services::Angle to specifically support hour angles.
HourAngle angle1(M_PI,"radians") both
HourAngle angle2(180.0,"degrees")
angle1 and angle2 represent the same physical quantity. Binary operations + and - are supported, as is the stream operation <<.
Definition at line 36 of file HourAngle.h.
| carma::services::HourAngle::HourAngle | ( | double | value, |
| const std::string & | units | ||
| ) |
Construct an HourAngle given a value and units.
| value | The value of this angle |
| units | The units of the value. |
|
virtual |
Destructor.
|
virtual |
Converts this quantity to any conformable units.
This method is virtual in case subclasses need to munge the input variable for conformability. (e.g. HourAngle)
| convertTo | A string representing the units to convert to. |
| ConformabilityException |
Reimplemented from carma::services::ConformableQuantity.
|
static |
return angle in a +/-hh:mm:ss.s format
| angle | angle in radians |
| precision | number of digits after decimal point for secondsx |
Definition at line 120 of file HourAngle.h.
| std::string carma::services::HourAngle::getLstString | ( | int | precision = 0 | ) |
Return LST for HourAngle value in +/-hh:mm:ss.s format.
| precision | number of digits after the decimal point |
| std::string carma::services::HourAngle::getString | ( | int | precision = 0 | ) |
Return the HourAngle value as a string in +/-hh:mm:ss.s format.
| precision | number of digits after the decimal point |
|
virtual |
Reimplemented from carma::services::ConformableQuantity.
| double carma::services::HourAngle::hours | ( | ) | const |
Convenience method that returns the value of this angle in hours.
Provides some backwards compatibility with sza::util::HourAngle.
Add two HourAngles.
| ConformabilityException |
Subtract two HourAngles.
| ConformabilityException |
|
virtual |
Reset method to change value and/or units.
This method is needed meant so that HourAngle can reassign "hours" to be "circle (hours/day)" so that Units will work transparently.
| value | The value of this quantity |
| units | The units of the value. |
Reimplemented from carma::services::ConformableQuantity.