Isis 3.0 Developer's Reference (API) |
Home |
Defines an angle and provides unit conversions. More...
#include <Angle.h>
Inherited by Isis::Latitude, and Isis::Longitude.
Public Types | |
enum | Units { Degrees, Radians } |
The set of usable angle measurement units. More... | |
Public Member Functions | |
Angle () | |
Constructs a blank angle object which needs a value to be set in order to do any calculations. | |
Angle (double angle, Units unit) | |
Constructs an angle object with the entered value and unit. | |
Angle (const Angle &angle) | |
Constructs an angle object from another Angle object. | |
virtual | ~Angle () |
Destroys the angle object. | |
bool | Valid () const |
This indicates whether we have a legitimate angle stored or are in an unset, or invalid, state. | |
Angle & | operator= (const Angle &angle2) |
Assign angle object equal to another. | |
Angle | operator+ (const Angle &angle2) const |
Add angle value to another. | |
Angle | operator- (const Angle &angle2) const |
Subtract angle value from another and return the resulting angle. | |
Angle | operator* (double value) const |
Multiply this angle by a double and return the resulting angle. | |
Angle | operator/ (double value) const |
Divide this angle by a double. | |
double | operator/ (Angle value) const |
Divide this angle by another angle and return the ratio. | |
bool | operator< (const Angle &angle2) const |
Test if the other angle is less than the current angle. | |
bool | operator> (const Angle &angle2) const |
Test if the other angle is greater than the current angle. | |
void | operator+= (const Angle &angle2) |
Add angle value to another as double and replace original. | |
void | operator-= (const Angle &angle2) |
Subtract angle value from another and set this instance to the resulting angle. | |
Angle | operator* (int value) const |
Multiply this angle by an integer and return the resulting angle. | |
void | operator*= (double value) |
Multiply this angle by a double and set this instance to the resulting angle. | |
Angle | operator/ (int value) const |
Divide this angle by an integer and return the resulting angle. | |
void | operator/= (double value) |
Divide this angle by a double and return the resulting angle. | |
bool | operator== (const Angle &angle2) const |
Test if another angle is equal to this angle. | |
bool | operator!= (const Angle &angle2) const |
Test if another angle is not equal to this angle. | |
bool | operator<= (const Angle &angle2) const |
Test if the other angle is less than or equal to the current angle. | |
bool | operator>= (const Angle &angle2) const |
Test if the other angle is greater than or equal to the current angle. | |
double | GetRadians () const |
Convert an angle to a double. | |
double | GetDegrees () const |
Get the angle in units of Degrees. | |
void | SetRadians (double radians) |
Set the angle in units of Radians. | |
void | SetDegrees (double degrees) |
Set the angle in units of Degrees. | |
Protected Member Functions | |
double | UnitWrapValue (const Units &unit) const |
Return wrap value in desired units. | |
virtual double | GetAngle (const Units &unit) const |
Return angle value in desired units. | |
virtual void | SetAngle (const double &angle, const Units &unit) |
Set angle value in desired units. | |
Friends | |
Angle | operator* (double mult, Angle angle) |
Multiply this angle by a double and return the resulting angle. |
Defines an angle and provides unit conversions.
enum Isis::Angle::Units |
The set of usable angle measurement units.
Isis::Angle::Angle | ( | ) |
Constructs a blank angle object which needs a value to be set in order to do any calculations.
References Isis::Null.
Referenced by Isis::Latitude::GetPlanetographic(), operator+(), and operator/().
Isis::Angle::Angle | ( | double | angle, | |
Units | unit | |||
) |
Constructs an angle object with the entered value and unit.
angle | The initial angle value in units of the unit parameter | |
unit | The unit of the initial angle (see Angle::Units) |
Isis::Angle::Angle | ( | const Angle & | fromAngle | ) |
Constructs an angle object from another Angle object.
fromAngle | The angle object to copy on initialization |
Isis::Angle::~Angle | ( | ) | [virtual] |
Destroys the angle object.
double Isis::Angle::GetAngle | ( | const Units & | unit | ) | const [protected, virtual] |
Return angle value in desired units.
unit | Desired units of the angle (see Angle::Units) |
References _FILEINFO_, Degrees, Isis::iException::Message(), Isis::Null, Isis::iException::Programmer, Isis::RAD2DEG(), and Radians.
Referenced by GetDegrees(), Isis::Longitude::GetPositiveEast(), Isis::Longitude::GetPositiveWest(), GetRadians(), operator<(), operator==(), and operator>().
double Isis::Angle::GetDegrees | ( | ) | const [inline] |
Get the angle in units of Degrees.
References Degrees, and GetAngle().
Referenced by Isis::ControlPoint::ComputeResiduals(), Isis::Sensor::DemRadius(), Isis::LineScanCameraGroundMap::FindFocalPlane(), Isis::Latitude::GetPlanetographic(), Isis::Sensor::LocalRadius(), Isis::ControlNetFilter::PointLatLonFilter(), Isis::UniversalGroundMap::Sample(), Isis::VimsGroundMap::SetGround(), Isis::UniversalGroundMap::SetGround(), Isis::Sensor::UniversalLatitude(), and Isis::Sensor::UniversalLongitude().
double Isis::Angle::GetRadians | ( | ) | const [inline] |
Convert an angle to a double.
This will return the radians version of the angle.
operator double() const { return GetAngle(Radians); } Get the angle in units of Radians.
References GetAngle(), and Radians.
Referenced by Isis::SurfacePoint::GetDistanceToPoint(), Isis::SurfacePoint::GetLatSigmaDistance(), Isis::SurfacePoint::GetLatWeight(), Isis::Camera::GetLocalNormal(), Isis::SurfacePoint::GetLonSigmaDistance(), Isis::SurfacePoint::GetLonWeight(), Isis::Latitude::GetPlanetographic(), Isis::Longitude::Longitude(), operator+(), operator/(), operator=(), Isis::CameraGroundMap::PointPartial(), Isis::SurfacePoint::ResetLocalRadius(), Isis::VimsGroundMap::SetGround(), and Isis::SurfacePoint::SetSphericalSigmas().
bool Isis::Angle::operator!= | ( | const Angle & | angle2 | ) | const [inline] |
Test if another angle is not equal to this angle.
Takes the negated result of the '==' operator.
angle2 | The comparison angle (on right-hand-side of != operator) |
Angle Isis::Angle::operator* | ( | int | value | ) | const [inline] |
Multiply this angle by an integer and return the resulting angle.
value | The integer value to multiply with this angle |
Angle Isis::Angle::operator* | ( | double | value | ) | const |
Multiply this angle by a double and return the resulting angle.
If this is an invalid angle, then the result will be an invalid angle.
value | The value to multiply to this angle |
void Isis::Angle::operator*= | ( | double | value | ) | [inline] |
Multiply this angle by a double and set this instance to the resulting angle.
value | The double value to multiply with this angle |
Add angle value to another.
If either of these are invalid angles, then the result will be an invalid angle.
angle2 | The angle to add to this angle |
References Angle(), GetRadians(), Radians, and Valid().
void Isis::Angle::operator+= | ( | const Angle & | angle2 | ) | [inline] |
Add angle value to another as double and replace original.
angle2 | The angle to add to this angle |
Subtract angle value from another and return the resulting angle.
If either of these are invalid angles, then the result will be an invalid angle.
angle2 | The angle to subtract from this angle |
void Isis::Angle::operator-= | ( | const Angle & | angle2 | ) | [inline] |
Subtract angle value from another and set this instance to the resulting angle.
angle2 | The angle to subtract from this angle |
Angle Isis::Angle::operator/ | ( | int | value | ) | const [inline] |
Divide this angle by an integer and return the resulting angle.
value | The double value to use as the divisor |
double Isis::Angle::operator/ | ( | Angle | value | ) | const |
Divide this angle by another angle and return the ratio.
value | The ratio, Null if invalid |
References GetRadians(), Isis::Null, and Valid().
Angle Isis::Angle::operator/ | ( | double | value | ) | const |
Divide this angle by a double.
value | The double value to use as the divisor |
References Angle(), GetRadians(), Radians, and Valid().
void Isis::Angle::operator/= | ( | double | value | ) | [inline] |
Divide this angle by a double and return the resulting angle.
value | The double value to use as the divisor |
bool Isis::Angle::operator< | ( | const Angle & | angle2 | ) | const |
Test if the other angle is less than the current angle.
If either is invalid, then an exception will be thrown.
angle2 | The comparison angle (on right-hand-side of < operator) |
References _FILEINFO_, GetAngle(), Isis::iException::Message(), Isis::iException::Programmer, Radians, and Valid().
bool Isis::Angle::operator<= | ( | const Angle & | angle2 | ) | const [inline] |
Test if the other angle is less than or equal to the current angle.
angle2 | The comparison angle (on right-hand-side of < operator) |
Assign angle object equal to another.
angle2 | The angle value to copy |
References GetRadians(), Radians, and SetAngle().
bool Isis::Angle::operator== | ( | const Angle & | angle2 | ) | const [inline] |
Test if another angle is equal to this angle.
This does not compensate for going around a circle: Angle(360, Angle::Degrees) does not equal Angle(0, Angle::Degrees)
Invalid angles are equal to each other.
angle2 | The comparison angle (on right-hand-side of == operator) |
References GetAngle(), and Radians.
bool Isis::Angle::operator> | ( | const Angle & | angle2 | ) | const |
Test if the other angle is greater than the current angle.
If either is invalid, then an exception will be thrown.
angle2 | The comparison angle (on right-hand-side of > operator) |
References _FILEINFO_, GetAngle(), Isis::iException::Message(), Isis::iException::Programmer, Radians, and Valid().
bool Isis::Angle::operator>= | ( | const Angle & | angle2 | ) | const [inline] |
Test if the other angle is greater than or equal to the current angle.
angle2 | The comparison angle (on right-hand-side of < operator) |
void Isis::Angle::SetAngle | ( | const double & | angle, | |
const Units & | unit | |||
) | [protected, virtual] |
Set angle value in desired units.
angle | The angle value in units of the unit parameter | |
unit | Desired units of the angle (see Angle::Units) |
References _FILEINFO_, Isis::DEG2RAD(), Degrees, Isis::IsSpecial(), Isis::iException::Message(), Isis::Null, Isis::iException::Programmer, and Radians.
Referenced by operator=(), SetDegrees(), and SetRadians().
void Isis::Angle::SetDegrees | ( | double | degrees | ) | [inline] |
Set the angle in units of Degrees.
degrees | The new angle value, Null for invalid angle |
References Degrees, and SetAngle().
void Isis::Angle::SetRadians | ( | double | radians | ) | [inline] |
Set the angle in units of Radians.
radians | The new angle value, Null for invalid angle |
References Radians, and SetAngle().
double Isis::Angle::UnitWrapValue | ( | const Units & | unit | ) | const [protected] |
Return wrap value in desired units.
The 'wrap' value is the value where one circle occurs - angles greater than this are conceptually 'wrapping' back to zero. For example, this is 2*PI in radians because 2*PI == 0 on a circle. Please keep in mind we still differentiate those two angles.
unit | Desired units of the Angle wrap constant (see Angle::Units) |
Referenced by Isis::Longitude::GetPositiveWest().
bool Isis::Angle::Valid | ( | ) | const |
This indicates whether we have a legitimate angle stored or are in an unset, or invalid, state.
References Isis::Null.
Referenced by Isis::GroundGrid::CreateGrid(), Isis::SurfacePoint::GetLatSigmaDistance(), Isis::SurfacePoint::GetLonSigmaDistance(), Isis::Latitude::GetPlanetographic(), Isis::GroundGrid::GroundGrid(), Isis::VimsGroundMap::Init(), operator+(), operator/(), operator<(), operator>(), Isis::ControlPoint::SetAprioriSurfacePoint(), Isis::VimsGroundMap::SetGround(), Isis::GroundGrid::SetGroundLimits(), Isis::SurfacePoint::SetSpherical(), and Isis::SurfacePoint::SetSphericalSigmas().
Multiply this angle by a double and return the resulting angle.
If this is an invalid angle, then the result will be an invalid angle.
mult | The value to multiply to this angle | |
angle | The angle being multiplied by mult |