ICAROUS
All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Modules Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
larcfm::LatLonAlt Class Reference

#include <LatLonAlt.h>

Public Member Functions

 LatLonAlt ()
 
bool operator== (const LatLonAlt &v) const
 
bool operator!= (const LatLonAlt &v) const
 
LatLonAltoperator= (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 LatLonAltZERO ()
 
static const LatLonAltINVALID ()
 
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
 

Detailed Description

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.


Constructor & Destructor Documentation

◆ LatLonAlt() [1/2]

larcfm::LatLonAlt::LatLonAlt ( double  x,
double  y,
double  z 
)
private

Creates a new position

◆ LatLonAlt() [2/2]

larcfm::LatLonAlt::LatLonAlt ( )

Make a LatLonAlt at (0,0,0)

Member Function Documentation

◆ alt()

double larcfm::LatLonAlt::alt ( ) const

Return altitude in internal units

Returns
altitude value

◆ altitude()

double larcfm::LatLonAlt::altitude ( ) const

Return altitude in [ft]

Returns
altitude in feet

◆ decimal_angle()

double larcfm::LatLonAlt::decimal_angle ( double  degrees,
double  minutes,
double  seconds,
bool  north_east 
)
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.

Parameters
degreesvalue of degrees
minutesvalue of minutes
secondsvalue of seconds
north_easttrue, if north or east
Returns
an angle

◆ equals()

bool larcfm::LatLonAlt::equals ( const LatLonAlt v) const

Are these two LatLonAlt objects equal?

◆ INVALID()

const LatLonAlt & larcfm::LatLonAlt::INVALID ( )
static

An invalid value, used for error reporting

◆ isInvalid()

bool larcfm::LatLonAlt::isInvalid ( ) const

Returns true if the current LatLonAlt has an "invalid" value

Returns
true if invalid

◆ isWest()

bool larcfm::LatLonAlt::isWest ( const LatLonAlt a) const

Return true if this point is (locally) west of the given point.

Parameters
areference point
Returns
true if this point is to the west of the reference point within a hemisphere they share.

◆ lat()

double larcfm::LatLonAlt::lat ( ) const

Return latitude in internal units

Returns
latitude value

◆ latitude()

double larcfm::LatLonAlt::latitude ( ) const

Return latitude in degrees north

Returns
latitude value in degrees

◆ linearEst() [1/2]

const LatLonAlt larcfm::LatLonAlt::linearEst ( const Velocity vo,
double  tm 
) const

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.

Parameters
vovelocity away from original position
tmtime of relocation
Returns
new lat/lon position in direction v0

◆ linearEst() [2/2]

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.

Parameters
dnoffset in north direction (m)
deoffset in east direction (m)
Returns
new position

◆ lon()

double larcfm::LatLonAlt::lon ( ) const

Return longitude in internal units

Returns
longitude value

◆ longitude()

double larcfm::LatLonAlt::longitude ( ) const

Return longitude in degrees east

Returns
longitude in degrees

◆ make() [1/3]

const LatLonAlt larcfm::LatLonAlt::make ( )
static

Creates a zero position

◆ make() [2/3]

const LatLonAlt larcfm::LatLonAlt::make ( double  lat,
double  lon,
double  alt 
)
static

Creates a new position with coordinates (lat,lon,alt).

Parameters
latlatitude [deg north latitude]
lonlongitude [deg east longitude]
altaltitude [ft]
Returns
new LatLonAlt object

◆ make() [3/3]

const LatLonAlt larcfm::LatLonAlt::make ( double  lat,
std::string  lat_unit,
double  lon,
std::string  lon_unit,
double  alt,
std::string  alt_unit 
)
static

Creates a new position with coordinates (lat,lon,alt).

Parameters
latlatitude [lat_unit north latitude]
lat_unitunits of latitude
lonlongitude [lon_unit east longitude]
lon_unitunits of longitude
altaltitude [alt_unit]
alt_unitunits of altitude
Returns
new LatLonAlt object

◆ makeAlt()

const LatLonAlt larcfm::LatLonAlt::makeAlt ( double  alt) const

Creates a new LatLonAlt with only altitude changed

Parameters
altaltitude [feet]
Returns
new LatLonAlt object with modified altitude

◆ mk() [1/2]

const LatLonAlt larcfm::LatLonAlt::mk ( const LatLonAlt v)
static

Creates a new position that is a copy of v.

Parameters
vposition object
Returns
new LatLonAlt object

◆ mk() [2/2]

const LatLonAlt larcfm::LatLonAlt::mk ( double  lat,
double  lon,
double  alt 
)
static

Creates a new position with given values

Parameters
latlatitude [internal]
lonlongitude [internal]
altaltitude [internal]
Returns
new LatLonAlt object

◆ mkAlt()

const LatLonAlt larcfm::LatLonAlt::mkAlt ( double  alt) const

Creates a new LatLonAlt with only altitude changed

Parameters
altaltitude [internal]
Returns
new LatLonAlt object with modified altitude

◆ normalize() [1/3]

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.

Returns
normalized LatLonAlt value

◆ normalize() [2/3]

LatLonAlt larcfm::LatLonAlt::normalize ( double  lat,
double  lon 
)
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.

Parameters
latlatitude
lonlongitude
Returns
normalized LatLonAlt value

◆ normalize() [3/3]

LatLonAlt larcfm::LatLonAlt::normalize ( double  lat,
double  lon,
double  alt 
)
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.

Parameters
latlatitude
lonlongitude
altaltitude
Returns
normalized LatLonAlt value

◆ operator!=()

bool larcfm::LatLonAlt::operator!= ( const LatLonAlt v) const

Are these two LatLonAlt objects unequal?

◆ operator==()

bool larcfm::LatLonAlt::operator== ( const LatLonAlt v) const

Are these two LatLonAlt objects equal?

◆ parse()

const LatLonAlt larcfm::LatLonAlt::parse ( const std::string &  str)
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.

Parameters
strstring representing a latitude and longitude
Returns
a LatLonAlt that corresponds to the given string

◆ toString() [1/4]

std::string larcfm::LatLonAlt::toString ( ) const

String representation with units of [deg,deg,ft]

◆ toString() [2/4]

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

Parameters
latunitunits for latitude
lonunitunits for longitude
zunitunits for altitude
Returns
string representation

◆ toString() [3/4]

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

Parameters
latunitunits for latitude
lonunitunits for longitude
zunitunits for altitude
precisionnumber of digits of precision for output
Returns
string representation

◆ toString() [4/4]

std::string larcfm::LatLonAlt::toString ( int  precision) const

String representation with units of [deg,deg,ft]

Parameters
precisiondigits of precision for the output values
Returns
string representation

◆ ZERO()

const LatLonAlt & larcfm::LatLonAlt::ZERO ( )
static

A default value representing zero latitude, longitude, and altitude

◆ zeroAlt()

const LatLonAlt larcfm::LatLonAlt::zeroAlt ( ) const

Return a copy of the current LatLonAlt with a zero altitude. This is useful for creating projections that need to preserve altitude

Returns
a LatLonAlt copy with a zero altitude

The documentation for this class was generated from the following files: