70 QString::SectionFlag flag = QString::SectionSkipEmpty;
71 bool degreesSucceeded, minutesSucceeded, secondsSucceeded;
73 double degrees = angle.section(
' ', 0, 0, flag).toDouble(°reesSucceeded);
74 double minutes = angle.section(
' ', 1, 1, flag).toDouble(&minutesSucceeded);
75 double seconds = angle.section(
' ', 2, 2, flag).toDouble(&secondsSucceeded);
77 if (!(degreesSucceeded && minutesSucceeded && secondsSucceeded) ) {
78 QString msg = QObject::tr(
"[%1] is not a vaid input to Angle. It needs to be of the form: "
79 "\"dd mm ss.ss\"").arg(angle);
89 double decimalDegrees = degrees + minutes/60.0 + seconds/3600.0;
137 double otherAngle = angle2.
radians();
155 double otherAngle = angle2.
radians();
225 IString msg =
"Cannot compare a invalid angles with the < operator";
242 IString msg =
"Cannot compare a invalid angles with the > operator";
257 QString textResult =
"";
263 textResult +=
" degrees";
290 IString msg =
"Angle can not interpret the enumerated value [" +
308 double angleValue =
Null;
320 if(angleValue ==
Null) {
321 IString msg =
"Angle can not interpret the enumerated value [" +
339 IString msg =
"Angle cannot be a non-Null special pixel";
359 IString msg =
"Angle can not interpret the enumerated value [" +
380 dbg.nospace() << angleToPrint.
radians() <<
" <radians> ("
381 << angleToPrint.
degrees() <<
" <degrees>)";
const double Null
Value for an Isis Null pixel.
Units
The set of usable angle measurement units.
Angle operator-(const Angle &angle2) const
Subtract angle value from another and return the resulting angle.
double degrees() const
Get the angle in units of Degrees.
double radians() const
Convert an angle to a double.
virtual void setAngle(const double &angle, const Units &unit)
Set angle value in desired units.
const double PI(3.14159265358979323846)
The mathematical constant PI.
const double DEG2RAD(0.017453292519943295769237)
Multiplier for converting from degrees to radians.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Angle operator*(double mult, Angle angle)
Multiply this angle by a double and return the resulting angle.
This error is for when a programmer made an API call that was illegal.
QDebug operator<<(QDebug dbg, const Isis::Angle &angleToPrint)
Display an Angle for a debugging statement.
Angle operator/(double value) const
Divide this angle by a double.
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
virtual QString toString(bool includeUnits=true) const
Get the angle in human-readable form.
Angle()
Constructs a blank angle object which needs a value to be set in order to do any calculations.
Angle operator*(double value) const
Multiply this angle by a double and return the resulting angle.
#define _FILEINFO_
Macro for the filename and line number.
Angle operator+(const Angle &angle2) const
Add angle value to another.
bool IsSpecial(const double d)
Returns if the input pixel is special.
bool isValid() const
This indicates whether we have a legitimate angle stored or are in an unset, or invalid, state.
static Angle fullRotation()
Makes an angle to represent a full rotation (0-360 or 0-2pi).
double unitWrapValue(const Units &unit) const
Return wrap value in desired units.
Defines an angle and provides unit conversions.
bool operator<(const Angle &angle2) const
Test if the other angle is less than the current angle.
virtual ~Angle()
Destroys the angle object.
Adds specific functionality to C++ strings.
bool operator>(const Angle &angle2) const
Test if the other angle is greater than the current angle.
Radians are generally used in mathematical equations, 0-2*PI is one circle, however these are more di...
virtual double angle(const Units &unit) const
Return angle value in desired units.
const double RAD2DEG(57.29577951308232087679815481)
Multiplier for converting from radians to degrees.
double m_radians
The angle measure, always stored in radians.