|
Isis 3 Programmer Reference
|
13 #include "Constants.h"
15 #include "IException.h"
16 #include "SpecialPixel.h"
55 QString::SectionFlag flag = QString::SectionSkipEmpty;
56 bool degreesSucceeded, minutesSucceeded, secondsSucceeded;
58 double degrees =
angle.section(
' ', 0, 0, flag).toDouble(°reesSucceeded);
59 double minutes =
angle.section(
' ', 1, 1, flag).toDouble(&minutesSucceeded);
60 double seconds =
angle.section(
' ', 2, 2, flag).toDouble(&secondsSucceeded);
62 if (!(degreesSucceeded && minutesSucceeded && secondsSucceeded) ) {
63 QString msg = QObject::tr(
"[%1] is not a vaid input to Angle. It needs to be of the form: "
64 "\"dd mm ss.ss\"").arg(
angle);
74 double decimalDegrees =
degrees + minutes/60.0 + seconds/3600.0;
122 double otherAngle = angle2.
radians();
140 double otherAngle = angle2.
radians();
210 IString msg =
"Cannot compare a invalid angles with the < operator";
228 IString msg =
"Cannot compare a invalid angles with the > operator";
244 QString textResult =
"";
250 textResult +=
" degrees";
277 IString msg =
"Angle can not interpret the enumerated value [" +
295 double angleValue =
Null;
307 if(angleValue ==
Null) {
308 IString msg =
"Angle can not interpret the enumerated value [" +
326 IString msg =
"Angle cannot be a non-Null special pixel";
346 IString msg =
"Angle can not interpret the enumerated value [" +
368 QDebug operator<<(QDebug dbg,
const Isis::Angle &angleToPrint) {
369 dbg.nospace() << angleToPrint.
radians() <<
" <radians> ("
370 << angleToPrint.
degrees() <<
" <degrees>)";
@ Degrees
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
Angle operator*(double value) const
Multiply this angle by a double and return the resulting angle.
Angle operator-(const Angle &angle2) const
Subtract angle value from another and return the resulting angle.
virtual QString toString(bool includeUnits=true) const
Get the angle in human-readable form.
const double PI
The mathematical constant PI.
Angle operator*(double mult, Angle angle)
Multiply this angle by a double and return the resulting angle.
const double DEG2RAD
Multiplier for converting from degrees to radians.
bool operator>(const Angle &angle2) const
Test if the other angle is greater than the current angle.
double m_radians
The angle measure, always stored in radians.
double unitWrapValue(const Units &unit) const
Return wrap value in desired units.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
bool IsSpecial(const double d)
Returns if the input pixel is special.
bool operator<(const Angle &angle2) const
Test if the other angle is less than the current angle.
Units
The set of usable angle measurement units.
Defines an angle and provides unit conversions.
const double Null
Value for an Isis Null pixel.
@ Programmer
This error is for when a programmer made an API call that was illegal.
virtual ~Angle()
Destroys the angle object.
Angle operator/(double value) const
Divide this angle by a double.
bool isValid() const
This indicates whether we have a legitimate angle stored or are in an unset, or invalid,...
Angle()
Constructs a blank angle object which needs a value to be set in order to do any calculations.
static Angle fullRotation()
Makes an angle to represent a full rotation (0-360 or 0-2pi).
Angle operator+(const Angle &angle2) const
Add angle value to another.
double degrees() const
Get the angle in units of Degrees.
virtual void setAngle(const double &angle, const Units &unit)
Set angle value in desired units.
Adds specific functionality to C++ strings.
const double RAD2DEG
Multiplier for converting from radians to degrees.
virtual double angle(const Units &unit) const
Return angle value in desired units.
@ Radians
Radians are generally used in mathematical equations, 0-2*PI is one circle, however these are more di...
This is free and unencumbered software released into the public domain.
double radians() const
Convert an angle to a double.