ICAROUS
|
#include <LatLonAlt.h>
Public Member Functions | |
LatLonAlt () | |
bool | operator== (const LatLonAlt &v) const |
bool | operator!= (const LatLonAlt &v) const |
LatLonAlt & | operator= (const LatLonAlt &lla) |
bool | equals (const LatLonAlt &v) const |
bool | equals2D (const LatLonAlt &lla) const |
double | latitude () const |
double | longitude () const |
double | altitude () const |
double | lat () const |
double | lon () const |
double | alt () const |
double | distanceH (const LatLonAlt &lla2) const |
std::string | toString () const |
std::string | toString (int precision) const |
std::string | toString (const std::string &latunit, const std::string &lonunit, const std::string &zunit) const |
std::string | toString (const std::string &latunit, const std::string &lonunit, const std::string &zunit, int p) const |
const LatLonAlt | mkAlt (double alt) const |
const LatLonAlt | makeAlt (double alt) const |
const LatLonAlt | zeroAlt () const |
bool | isInvalid () const |
const LatLonAlt | linearEst (double dn, double de) const |
const LatLonAlt | linearEst (const Velocity &vo, double tm) const |
LatLonAlt | normalize () const |
bool | isWest (const LatLonAlt &a) const |
double | track (const LatLonAlt &p) const |
Static Public Member Functions | |
static double | decimal_angle (double degrees, double minutes, double seconds, bool north_east) |
static const LatLonAlt | make () |
static const LatLonAlt | mk (const LatLonAlt &v) |
static const LatLonAlt | make (double lat, double lon, double alt) |
static const LatLonAlt | make (double lat, std::string lat_unit, double lon, std::string lon_unit, double alt, std::string alt_unit) |
static const LatLonAlt | mk (double lat, double lon, double alt) |
static const LatLonAlt & | ZERO () |
static const LatLonAlt & | INVALID () |
static const LatLonAlt | parse (const std::string &str) |
static LatLonAlt | normalize (double lat, double lon, double alt) |
static LatLonAlt | normalize (double lat, double lon) |
Private Member Functions | |
LatLonAlt (double x, double y, double z) | |
Private Attributes | |
double | lati |
double | longi |
double | alti |
Container to hold a latitude/longitude/altitude position.
Programmer's note: There has been a tendency to have methods in LatLonAlt rely on functions in GreatCircle. But GreatCircle depends on LatLonAlt in a fundamental way. Although Java handles circular dependencies in a reasonable manner, they can be confusing and error-prone in many contexts. At best, circular references are dangerous. So to avoid the danger, should GreatCircle depend on LatLonAlt or the other way around? The choice has been made that GreatCircle will depend on LatLonAlt. Therefore, please do not add any references to GreatCircle in this class. Over time we will remove any remaining GreatCircle references here. One important reason for the dependences being setup the way they are is that LatLonAlt can be used with other Earth models besides the spherical, non-rotating model used in GreatCircle.
|
private |
Creates a new position
larcfm::LatLonAlt::LatLonAlt | ( | ) |
Make a LatLonAlt at (0,0,0)
double larcfm::LatLonAlt::alt | ( | ) | const |
Return altitude in internal units
double larcfm::LatLonAlt::altitude | ( | ) | const |
Return altitude in [ft]
|
static |
Convert an angle in degrees/minutes/seconds into internal units (radians). The flag indicates if this angle is north (latitude) or east (longitude). If the angle does not represent a latitude/longitude (it is only an angle), then set the north_east flag tbo true.
If the degrees is negative (representing south or west), then the flag is ignored.
degrees | value of degrees |
minutes | value of minutes |
seconds | value of seconds |
north_east | true, if north or east |
|
static |
An invalid value, used for error reporting
bool larcfm::LatLonAlt::isInvalid | ( | ) | const |
Returns true if the current LatLonAlt has an "invalid" value
bool larcfm::LatLonAlt::isWest | ( | const LatLonAlt & | a | ) | const |
Return true if this point is (locally) west of the given point.
a | reference point |
double larcfm::LatLonAlt::lat | ( | ) | const |
Return latitude in internal units
double larcfm::LatLonAlt::latitude | ( | ) | const |
Return latitude in degrees north
Compute a new lat/lon that is obtained by moving with velocity vo for tm secs This is a computationally fast estimate, and only should be used for relatively short distances.
vo | velocity away from original position |
tm | time of relocation |
const LatLonAlt larcfm::LatLonAlt::linearEst | ( | double | dn, |
double | de | ||
) | const |
Compute a new lat/lon that is offset by dn meters north and de meters east. This is a computationally fast estimate, and only should be used for relatively short distances.
dn | offset in north direction (m) |
de | offset in east direction (m) |
double larcfm::LatLonAlt::lon | ( | ) | const |
Return longitude in internal units
double larcfm::LatLonAlt::longitude | ( | ) | const |
Return longitude in degrees east
|
static |
Creates a zero position
|
static |
Creates a new position with coordinates (lat
,lon
,alt
).
lat | latitude [deg north latitude] |
lon | longitude [deg east longitude] |
alt | altitude [ft] |
|
static |
Creates a new position with coordinates (lat
,lon
,alt
).
lat | latitude [lat_unit north latitude] |
lat_unit | units of latitude |
lon | longitude [lon_unit east longitude] |
lon_unit | units of longitude |
alt | altitude [alt_unit] |
alt_unit | units of altitude |
const LatLonAlt larcfm::LatLonAlt::makeAlt | ( | double | alt | ) | const |
|
static |
Creates a new position with given values
lat | latitude [internal] |
lon | longitude [internal] |
alt | altitude [internal] |
const LatLonAlt larcfm::LatLonAlt::mkAlt | ( | double | alt | ) | const |
LatLonAlt larcfm::LatLonAlt::normalize | ( | ) | const |
Creates a new LatLonAlt object from the current LatLonAlt object so that latitude and longitude values are conventional spherical angles. Thus values over the pole will map to the other side of the pole or merdian. For example 95 degrees of latitude converts to 85 degrees and 190 degrees west longitude map to 170 of east longitude.
|
static |
Normalizes the given latitude and longitude values to conventional spherical angles. Thus values over the pole will map to the other side of the pole or merdian. For example 95 degrees of latitude converts to 85 degrees and 190 degrees west longitude map to 170 of east longitude. The altitude is assumed to be zero.
lat | latitude |
lon | longitude |
|
static |
Normalizes the given latitude and longitude values to conventional spherical angles. Thus values over the pole will map to the other side of the pole or merdian. For example 95 degrees of latitude converts to 85 degrees and 190 degrees west longitude map to 170 of east longitude.
lat | latitude |
lon | longitude |
alt | altitude |
bool larcfm::LatLonAlt::operator!= | ( | const LatLonAlt & | v | ) | const |
Are these two LatLonAlt objects unequal?
bool larcfm::LatLonAlt::operator== | ( | const LatLonAlt & | v | ) | const |
Are these two LatLonAlt objects equal?
|
static |
This parses a space or comma-separated string as a LatLonAlt (an inverse to the toString method). If three bare values are present, then it is interpreted as deg/deg/ft. If there are 3 value/unit pairs then each values is interpreted with regard to the appropriate unit. If the string cannot be parsed, an INVALID value is returned.
str | string representing a latitude and longitude |
std::string larcfm::LatLonAlt::toString | ( | ) | const |
String representation with units of [deg,deg,ft]
std::string larcfm::LatLonAlt::toString | ( | const std::string & | latunit, |
const std::string & | lonunit, | ||
const std::string & | zunit | ||
) | const |
Return a string representation consistent with StateReader or PlanReader with user-specified units and precision
latunit | units for latitude |
lonunit | units for longitude |
zunit | units for altitude |
std::string larcfm::LatLonAlt::toString | ( | const std::string & | latunit, |
const std::string & | lonunit, | ||
const std::string & | zunit, | ||
int | p | ||
) | const |
Return a string representation consistent with StateReader or PlanReader with user-specified units and precision
latunit | units for latitude |
lonunit | units for longitude |
zunit | units for altitude |
precision | number of digits of precision for output |
std::string larcfm::LatLonAlt::toString | ( | int | precision | ) | const |
String representation with units of [deg,deg,ft]
precision | digits of precision for the output values |
|
static |
A default value representing zero latitude, longitude, and altitude
const LatLonAlt larcfm::LatLonAlt::zeroAlt | ( | ) | const |