Isis 3.0 Developer's Reference (API) |
Home |
This class is designed to encapsulate the concept of a Latitude. More...
#include <Latitude.h>
Inherits Isis::Angle.
Public Types | |
enum | ErrorChecking { ThrowAllErrors = 0, AllowPastPole } |
Some user-configurable error checking parameters. More... | |
enum | CoordinateType { Planetocentric, Planetographic } |
These are the latitude coordinate systems. More... | |
enum | Units { Degrees, Radians } |
The set of usable angle measurement units. More... | |
Public Member Functions | |
Latitude () | |
Create a blank Latitude object without Planetographic support. | |
Latitude (double latitude, Angle::Units latitudeUnits, ErrorChecking errors=ThrowAllErrors) | |
Create and initialize a Latitude value without planetographic support. | |
Latitude (Angle latitude, ErrorChecking errors=ThrowAllErrors) | |
Create and initialize a Latitude value in the planetocentric domain within the given angle. | |
Latitude (Angle latitude, PvlGroup mapping, ErrorChecking errors=ThrowAllErrors) | |
Create and initialize a Latitude value using the mapping group's latitude units and radii. | |
Latitude (double latitude, PvlGroup mapping, Angle::Units latitudeUnits, ErrorChecking errors=ThrowAllErrors) | |
Create and initialize a Latitude value using the mapping group's latitude units and radii. | |
Latitude (double latitude, Distance equatorialRadius, Distance polarRadius, CoordinateType latType=Planetocentric, Angle::Units latitudeUnits=Angle::Radians, ErrorChecking errors=ThrowAllErrors) | |
Create and initialize a Latitude value with planetographic support. | |
Latitude (const Latitude &latitudeToCopy) | |
This copies the given latitude exactly. | |
~Latitude () | |
This cleans up the Latitude class. | |
double | GetPlanetocentric (Angle::Units units=Angle::Radians) const |
Get the latitude in the planetocentric (universal) coordinate system. | |
void | SetPlanetocentric (double latitude, Angle::Units units=Angle::Radians) |
Set the latitude given a value in the Planetocentric coordinate system. | |
double | GetPlanetographic (Angle::Units units=Angle::Radians) const |
Get the latitude in the planetographic coordinate system. | |
void | SetPlanetographic (double latitude, Angle::Units units=Angle::Radians) |
Set the latitude given a value in the Planetographic coordinate system. | |
bool | IsInRange (Latitude min, Latitude max) const |
Checks if this latitude value is within the given range. | |
Latitude & | operator= (const Latitude &latitudeToCopy) |
This assigns another latitude to this one - making this latitude an exact duplicate of the other. | |
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) 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* (int value) const |
Multiply this angle by an integer 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. | |
Angle | operator/ (int value) const |
Divide this angle by an integer and return the resulting angle. | |
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. | |
void | operator*= (double value) |
Multiply this angle by a double and set this instance to 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 | |
virtual void | SetAngle (double angle, const Angle::Units &units) |
Same as GetPlanetocentric. | |
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. |
This class is designed to encapsulate the concept of a Latitude.
This is used primary for surface points but is also a general purpose class. This class has error checking for past the poles. This adds the concept of 90/-90 and planetographic to the Angle class.
These are the latitude coordinate systems.
The universal system is Planetocentric and this class is heavily geared towards using them. If you wish to use Planetographic, planetary radii must be provided and at the moment latitudes past 90 aren't supported in Planetographic.
Some user-configurable error checking parameters.
This is meant to be used as a bit flag.
Example: Latitude(95, Angle::Degrees, Latitude::AllowPastPole) This will allow latitudes past 90 and not throw an exception.
Latitude(95, Angle::Degrees, Latitude::AllowPastPole | Latitude::ThrowAllErrors) This will allow latitudes past 90 still and not throw an exception.
Latitude(95, Angle::Degrees, Latitude::ThrowAllErrors) This will throw an exception.
Latitude(95, Angle::Degrees) This will throw an exception.
enum Isis::Angle::Units [inherited] |
The set of usable angle measurement units.
Isis::Latitude::Latitude | ( | ) |
Isis::Latitude::Latitude | ( | double | latitude, | |
Angle::Units | latitudeUnits, | |||
ErrorChecking | errors = ThrowAllErrors | |||
) |
Create and initialize a Latitude value without planetographic support.
latitude | The latitude value this instance will represent, in the planetocentric coordinate system | |
latitudeUnits | The angular units of the latitude value (degs, rads) | |
errors | Error checking conditions |
Isis::Latitude::Latitude | ( | Angle | latitude, | |
ErrorChecking | errors = ThrowAllErrors | |||
) |
Create and initialize a Latitude value in the planetocentric domain within the given angle.
latitude | The latitude value this instance will represent | |
errors | Error checking conditions |
Isis::Latitude::Latitude | ( | Angle | latitude, | |
PvlGroup | mapping, | |||
ErrorChecking | errors = ThrowAllErrors | |||
) |
Create and initialize a Latitude value using the mapping group's latitude units and radii.
latitude | The latitude value this instance will represent, in the mapping group's units | |
mapping | A mapping group | |
latitudeUnits | The angular units of the latitude value (degs, rads) | |
errors | Error checking conditions |
Isis::Latitude::Latitude | ( | double | latitude, | |
PvlGroup | mapping, | |||
Angle::Units | latitudeUnits, | |||
ErrorChecking | errors = ThrowAllErrors | |||
) |
Create and initialize a Latitude value using the mapping group's latitude units and radii.
latitude | The latitude value this instance will represent, in the mapping group's units | |
mapping | A mapping group | |
latitudeUnits | The angular units of the latitude value (degs, rads) | |
errors | Error checking conditions |
Isis::Latitude::Latitude | ( | double | latitude, | |
Distance | equatorialRadius, | |||
Distance | polarRadius, | |||
CoordinateType | latType = Planetocentric , |
|||
Angle::Units | latitudeUnits = Angle::Radians , |
|||
ErrorChecking | errors = ThrowAllErrors | |||
) |
Create and initialize a Latitude value with planetographic support.
latitude | The latitude value this instance will represent, in planetocentric | |
equatorialRadius | Radius of the target (planet) at the equator | |
polarRadius | Radius of the target (planet) at the poles | |
latType | The coordinate system of the latitude parameter | |
latitudeUnits | The angular units of the latitude value (degs, rads) | |
errors | Error checking conditions |
Isis::Latitude::Latitude | ( | const Latitude & | latitudeToCopy | ) |
This copies the given latitude exactly.
latitudeToCopy | The latitude we're duplicating |
Isis::Latitude::~Latitude | ( | ) |
This cleans up the Latitude class.
double Isis::Angle::GetAngle | ( | const Units & | unit | ) | const [protected, virtual, inherited] |
Return angle value in desired units.
unit | Desired units of the angle (see Angle::Units) |
References _FILEINFO_, Isis::Angle::Degrees, Isis::iException::Message(), Isis::Null, Isis::iException::Programmer, Isis::RAD2DEG(), and Isis::Angle::Radians.
Referenced by Isis::Angle::GetDegrees(), Isis::Longitude::GetPositiveEast(), Isis::Longitude::GetPositiveWest(), Isis::Angle::GetRadians(), Isis::Angle::operator<(), Isis::Angle::operator==(), and Isis::Angle::operator>().
double Isis::Angle::GetDegrees | ( | ) | const [inline, inherited] |
Get the angle in units of Degrees.
References Isis::Angle::Degrees, and Isis::Angle::GetAngle().
Referenced by Isis::ControlPoint::ComputeResiduals(), Isis::Sensor::DemRadius(), Isis::LineScanCameraGroundMap::FindFocalPlane(), 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::Latitude::GetPlanetocentric | ( | Angle::Units | units = Angle::Radians |
) | const |
Get the latitude in the planetocentric (universal) coordinate system.
units | The angular units to get the latitude in |
double Isis::Latitude::GetPlanetographic | ( | Angle::Units | units = Angle::Radians |
) | const |
Get the latitude in the planetographic coordinate system.
If this instance was not constructed with the planetary radii, then an exception will be thrown.
units | The angular units to get the latitude in |
References _FILEINFO_, Isis::Angle::Angle(), Isis::Angle::Degrees, Isis::Angle::GetDegrees(), Isis::Angle::GetRadians(), Isis::iException::Message(), Isis::iException::Programmer, and Isis::Angle::Valid().
double Isis::Angle::GetRadians | ( | ) | const [inline, inherited] |
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 Isis::Angle::GetAngle(), and Isis::Angle::Radians.
Referenced by Isis::SurfacePoint::GetDistanceToPoint(), Isis::SurfacePoint::GetLatSigmaDistance(), Isis::SurfacePoint::GetLatWeight(), Isis::Camera::GetLocalNormal(), Isis::SurfacePoint::GetLonSigmaDistance(), Isis::SurfacePoint::GetLonWeight(), GetPlanetographic(), Isis::Longitude::Longitude(), Isis::Angle::operator+(), Isis::Angle::operator/(), Isis::Angle::operator=(), Isis::CameraGroundMap::PointPartial(), Isis::SurfacePoint::ResetLocalRadius(), Isis::VimsGroundMap::SetGround(), and Isis::SurfacePoint::SetSphericalSigmas().
Checks if this latitude value is within the given range.
Defines the range as the change from the minimum latitude to the maximum latitude (an angle), and returns whether the change from the minimum latitude to this latitude is less than or equal to the maximum change allowed (the range).
min | The beginning of the valid latitude range | |
max | The end of the valid latitude range |
bool Isis::Angle::operator!= | ( | const Angle & | angle2 | ) | const [inline, inherited] |
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, inherited] |
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 [inherited] |
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, inherited] |
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 Isis::Angle::Angle(), Isis::Angle::GetRadians(), Isis::Angle::Radians, and Isis::Angle::Valid().
void Isis::Angle::operator+= | ( | const Angle & | angle2 | ) | [inline, inherited] |
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, inherited] |
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, inherited] |
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 [inherited] |
Divide this angle by another angle and return the ratio.
value | The ratio, Null if invalid |
References Isis::Angle::GetRadians(), Isis::Null, and Isis::Angle::Valid().
Angle Isis::Angle::operator/ | ( | double | value | ) | const [inherited] |
Divide this angle by a double.
value | The double value to use as the divisor |
References Isis::Angle::Angle(), Isis::Angle::GetRadians(), Isis::Angle::Radians, and Isis::Angle::Valid().
void Isis::Angle::operator/= | ( | double | value | ) | [inline, inherited] |
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 [inherited] |
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_, Isis::Angle::GetAngle(), Isis::iException::Message(), Isis::iException::Programmer, Isis::Angle::Radians, and Isis::Angle::Valid().
bool Isis::Angle::operator<= | ( | const Angle & | angle2 | ) | const [inline, inherited] |
Test if the other angle is less than or equal to the current angle.
angle2 | The comparison angle (on right-hand-side of < operator) |
This assigns another latitude to this one - making this latitude an exact duplicate of the other.
latitudeToCopy | The latitude we are assigning from |
bool Isis::Angle::operator== | ( | const Angle & | angle2 | ) | const [inline, inherited] |
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 Isis::Angle::GetAngle(), and Isis::Angle::Radians.
bool Isis::Angle::operator> | ( | const Angle & | angle2 | ) | const [inherited] |
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_, Isis::Angle::GetAngle(), Isis::iException::Message(), Isis::iException::Programmer, Isis::Angle::Radians, and Isis::Angle::Valid().
bool Isis::Angle::operator>= | ( | const Angle & | angle2 | ) | const [inline, inherited] |
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, inherited] |
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(), Isis::Angle::Degrees, Isis::IsSpecial(), Isis::iException::Message(), Isis::Null, Isis::iException::Programmer, and Isis::Angle::Radians.
Referenced by Isis::Angle::operator=(), Isis::Angle::SetDegrees(), and Isis::Angle::SetRadians().
void Isis::Latitude::SetAngle | ( | double | angle, | |
const Angle::Units & | units | |||
) | [protected, virtual] |
Same as GetPlanetocentric.
We're overriding this method in order to do -90/90 degree checking.
operator double() const { return GetPlanetocentric(); }
angle | The numeric value of the angle | |
units | The units angle is in (radians or degrees typically) |
void Isis::Angle::SetDegrees | ( | double | degrees | ) | [inline, inherited] |
Set the angle in units of Degrees.
degrees | The new angle value, Null for invalid angle |
References Isis::Angle::Degrees, and Isis::Angle::SetAngle().
void Isis::Latitude::SetPlanetocentric | ( | double | latitude, | |
Angle::Units | units = Angle::Radians | |||
) |
Set the latitude given a value in the Planetocentric coordinate system.
latitude | The planetographic latitude to set ourselves to | |
units | The angular units latitude is in |
void Isis::Latitude::SetPlanetographic | ( | double | latitude, | |
Angle::Units | units = Angle::Radians | |||
) |
Set the latitude given a value in the Planetographic coordinate system.
latitude | The planetographic latitude to set ourselves to | |
units | The angular units latitude is in |
void Isis::Angle::SetRadians | ( | double | radians | ) | [inline, inherited] |
Set the angle in units of Radians.
radians | The new angle value, Null for invalid angle |
References Isis::Angle::Radians, and Isis::Angle::SetAngle().
double Isis::Angle::UnitWrapValue | ( | const Units & | unit | ) | const [protected, inherited] |
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 [inherited] |
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(), GetPlanetographic(), Isis::GroundGrid::GroundGrid(), Isis::VimsGroundMap::Init(), Isis::Angle::operator+(), Isis::Angle::operator/(), Isis::Angle::operator<(), Isis::Angle::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 |