Updraft  1.0
Open source glider flight visualisation tool.
GeographicLib::Geodesic Class Reference

Geodesic calculations More...

#include <Geodesic.hpp>

Collaboration diagram for GeographicLib::Geodesic:

List of all members.

Public Types

enum  mask {
  NONE, LATITUDE, LONGITUDE, AZIMUTH,
  DISTANCE, DISTANCE_IN, REDUCEDLENGTH, GEODESICSCALE,
  AREA, ALL
}
 Bit masks for what calculations to do. More...

Public Member Functions

Constructor
 Geodesic (real a, real f)
 Constructor for a ellipsoid with.
Direct geodesic problem specified in terms of distance.
Math::real Direct (real lat1, real lon1, real azi1, real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21, real &S12) const throw ()
 Perform the direct geodesic calculation where the length of the geodesic is specify in terms of distance.
Math::real Direct (real lat1, real lon1, real azi1, real s12, real &lat2, real &lon2) const throw ()
 See the documentation for Geodesic::Direct.
Math::real Direct (real lat1, real lon1, real azi1, real s12, real &lat2, real &lon2, real &azi2) const throw ()
 See the documentation for Geodesic::Direct.
Math::real Direct (real lat1, real lon1, real azi1, real s12, real &lat2, real &lon2, real &azi2, real &m12) const throw ()
 See the documentation for Geodesic::Direct.
Math::real Direct (real lat1, real lon1, real azi1, real s12, real &lat2, real &lon2, real &azi2, real &M12, real &M21) const throw ()
 See the documentation for Geodesic::Direct.
Math::real Direct (real lat1, real lon1, real azi1, real s12, real &lat2, real &lon2, real &azi2, real &m12, real &M12, real &M21) const throw ()
 See the documentation for Geodesic::Direct.
Direct geodesic problem specified in terms of arc length.
void ArcDirect (real lat1, real lon1, real azi1, real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21, real &S12) const throw ()
 Perform the direct geodesic calculation where the length of the geodesic is specify in terms of arc length.
void ArcDirect (real lat1, real lon1, real azi1, real a12, real &lat2, real &lon2) const throw ()
 See the documentation for Geodesic::ArcDirect.
void ArcDirect (real lat1, real lon1, real azi1, real a12, real &lat2, real &lon2, real &azi2) const throw ()
 See the documentation for Geodesic::ArcDirect.
void ArcDirect (real lat1, real lon1, real azi1, real a12, real &lat2, real &lon2, real &azi2, real &s12) const throw ()
 See the documentation for Geodesic::ArcDirect.
void ArcDirect (real lat1, real lon1, real azi1, real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12) const throw ()
 See the documentation for Geodesic::ArcDirect.
void ArcDirect (real lat1, real lon1, real azi1, real a12, real &lat2, real &lon2, real &azi2, real &s12, real &M12, real &M21) const throw ()
 See the documentation for Geodesic::ArcDirect.
void ArcDirect (real lat1, real lon1, real azi1, real a12, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21) const throw ()
 See the documentation for Geodesic::ArcDirect.
General version of the direct geodesic solution.
Math::real GenDirect (real lat1, real lon1, real azi1, bool arcmode, real s12_a12, unsigned outmask, real &lat2, real &lon2, real &azi2, real &s12, real &m12, real &M12, real &M21, real &S12) const throw ()
 The general direct geodesic calculation.
Inverse geodesic problem.
Math::real Inverse (real lat1, real lon1, real lat2, real lon2, real &s12, real &azi1, real &azi2, real &m12, real &M12, real &M21, real &S12) const throw ()
 Perform the inverse geodesic calculation.
Math::real Inverse (real lat1, real lon1, real lat2, real lon2, real &s12) const throw ()
 See the documentation for Geodesic::Inverse.
Math::real Inverse (real lat1, real lon1, real lat2, real lon2, real &azi1, real &azi2) const throw ()
 See the documentation for Geodesic::Inverse.
Math::real Inverse (real lat1, real lon1, real lat2, real lon2, real &s12, real &azi1, real &azi2) const throw ()
 See the documentation for Geodesic::Inverse.
Math::real Inverse (real lat1, real lon1, real lat2, real lon2, real &s12, real &azi1, real &azi2, real &m12) const throw ()
 See the documentation for Geodesic::Inverse.
Math::real Inverse (real lat1, real lon1, real lat2, real lon2, real &s12, real &azi1, real &azi2, real &M12, real &M21) const throw ()
 See the documentation for Geodesic::Inverse.
Math::real Inverse (real lat1, real lon1, real lat2, real lon2, real &s12, real &azi1, real &azi2, real &m12, real &M12, real &M21) const throw ()
 See the documentation for Geodesic::Inverse.
General version of inverse geodesic solution.
Math::real GenInverse (real lat1, real lon1, real lat2, real lon2, unsigned outmask, real &s12, real &azi1, real &azi2, real &m12, real &M12, real &M21, real &S12) const throw ()
 The general inverse geodesic calculation.
Interface to GeodesicLine.
GeodesicLine Line (real lat1, real lon1, real azi1, unsigned caps=ALL) const throw ()
 Set up to compute several points on a singe geodesic.
Inspector functions.
Math::real MajorRadius () const throw ()
Math::real Flattening () const throw ()
Math::real EllipsoidArea () const throw ()

Static Public Attributes

static const Geodesic WGS84
 A global instantiation of Geodesic with the parameters for the WGS84 ellipsoid.

Private Types

enum  captype {
  CAP_NONE = 0U, CAP_C1 = 1U<<0, CAP_C1p = 1U<<1, CAP_C2 = 1U<<2,
  CAP_C3 = 1U<<3, CAP_C4 = 1U<<4, CAP_ALL = 0x1FU, OUT_ALL = 0x7F80U
}
typedef Math::real real

Private Member Functions

void Lengths (real eps, real sig12, real ssig1, real csig1, real ssig2, real csig2, real cbet1, real cbet2, real &s12s, real &m12a, real &m0, bool scalep, real &M12, real &M21, real C1a[], real C2a[]) const throw ()
real InverseStart (real sbet1, real cbet1, real sbet2, real cbet2, real lam12, real &salp1, real &calp1, real &salp2, real &calp2, real C1a[], real C2a[]) const throw ()
real Lambda12 (real sbet1, real cbet1, real sbet2, real cbet2, real salp1, real calp1, real &salp2, real &calp2, real &sig12, real &ssig1, real &csig1, real &ssig2, real &csig2, real &eps, real &domg12, bool diffp, real &dlam12, real C1a[], real C2a[], real C3a[]) const throw ()
void A3coeff () throw ()
real A3f (real eps) const throw ()
void C3coeff () throw ()
void C3f (real eps, real c[]) const throw ()
void C4coeff () throw ()
void C4f (real k2, real c[]) const throw ()

Static Private Member Functions

static real SinCosSeries (bool sinp, real sinx, real cosx, const real c[], int n) throw ()
static real AngNormalize (real x) throw ()
static real AngRound (real x) throw ()
static void SinCosNorm (real &sinx, real &cosx) throw ()
static real Astroid (real x, real y) throw ()
static real A1m1f (real eps) throw ()
static void C1f (real eps, real c[]) throw ()
static void C1pf (real eps, real c[]) throw ()
static real A2m1f (real eps) throw ()
static void C2f (real eps, real c[]) throw ()

Private Attributes

real _a
real _f
real _f1
real _e2
real _ep2
real _n
real _b
real _c2
real _etol2
real _A3x [nA3x_]
real _C3x [nC3x_]
real _C4x [nC4x_]

Static Private Attributes

static const int nA1_ = GEOD_ORD
static const int nC1_ = GEOD_ORD
static const int nC1p_ = GEOD_ORD
static const int nA2_ = GEOD_ORD
static const int nC2_ = GEOD_ORD
static const int nA3_ = GEOD_ORD
static const int nA3x_ = nA3_
static const int nC3_ = GEOD_ORD
static const int nC3x_ = (nC3_ * (nC3_ - 1)) / 2
static const int nC4_ = GEOD_ORD
static const int nC4x_ = (nC4_ * (nC4_ + 1)) / 2
static const unsigned maxit_ = 50
static const real tiny_ = sqrt(numeric_limits<real>::min())
static const real tol0_ = numeric_limits<real>::epsilon()
static const real tol1_ = 200 * tol0_
static const real tol2_ = sqrt(numeric_limits<real>::epsilon())
static const real xthresh_ = 1000 * tol2_

Friends

class GeodesicLine

Detailed Description

Geodesic calculations

The shortest path between two points on a ellipsoid at (lat1, lon1) and (lat2, lon2) is called the geodesic. Its length is s12 and the geodesic from point 1 to point 2 has azimuths azi1 and azi2 at the two end points. (The azimuth is the heading measured clockwise from north. azi2 is the "forward" azimuth, i.e., the heading that takes you beyond point 2 not back to point 1.)

Given lat1, lon1, azi1, and s12, we can determine lat2, lon2, and azi2. This is the direct geodesic problem and its solution is given by the function Geodesic::Direct. (If s12 is sufficiently large that the geodesic wraps more than halfway around the earth, there will be another geodesic between the points with a smaller s12.)

Given lat1, lon1, lat2, and lon2, we can determine azi1, azi2, and s12. This is the inverse geodesic problem, whose solution is given by Geodesic::Inverse. Usually, the solution to the inverse problem is unique. In cases where there are multiple solutions (all with the same s12, of course), all the solutions can be easily generated once a particular solution is provided.

The standard way of specifying the direct problem is the specify the distance s12 to the second point. However it is sometimes useful instead to specify the the arc length a12 (in degrees) on the auxiliary sphere. This is a mathematical construct used in solving the geodesic problems. The solution of the direct problem in this form is provide by Geodesic::ArcDirect. An arc length in excess of 180o indicates that the geodesic is not a shortest path. In addition, the arc length between an equatorial crossing and the next extremum of latitude for a geodesic is 90o.

This class can also calculate several other quantities related to geodesics. These are:

  • reduced length. If we fix the first point and increase azi1 by dazi1 (radians), the the second point is displaced m12 dazi1 in the direction azi2 + 90o. The quantity m12 is called the "reduced length" and is symmetric under interchange of the two points. On a curved surface the reduced length obeys a symmetry relation, m12 + m21 = 0. On a flat surface, we have m12 = s12. The ratio s12/m12 gives the azimuthal scale for an azimuthal equidistant projection.
  • geodesic scale. Consider a reference geodesic and a second geodesic parallel to this one at point 1 and separated by a small distance dt. The separation of the two geodesics at point 2 is M12 dt where M12 is called the "geodesic scale". M21 is defined similarly (with the geodesics being parallel at point 2). On a flat surface, we have M12 = M21 = 1. The quantity 1/M12 gives the scale of the Cassini-Soldner projection.
  • area. Consider the quadrilateral bounded by the following lines: the geodesic from point 1 to point 2, the meridian from point 2 to the equator, the equator from lon2 to lon1, the meridian from the equator to point 1. The area of this quadrilateral is represented by S12 with a clockwise traversal of the perimeter counting as a positive area and it can be used to compute the area of any simple geodesic polygon.

Overloaded versions of Geodesic::Direct, Geodesic::ArcDirect, and Geodesic::Inverse allow these quantities to be returned. In addition there are general functions Geodesic::GenDirect, and Geodesic::GenInverse which allow an arbitrary set of results to be computed. The quantities m12, M12, M21 which all specify the behavior of nearby geodesics obey addition rules. Let points 1, 2, and 3 all lie on a single geodesic, then

  • m13 = m12 M23 + m23 M21
  • M13 = M12 M23 - (1 - M12 M21) m23 / m12
  • M31 = M32 M21 - (1 - M23 M32) m12 / m23

Additional functionality is provided by the GeodesicLine class, which allows a sequence of points along a geodesic to be computed.

The calculations are accurate to better than 15 nm (15 nanometers). See Sec. 9 of arXiv:1102.1215v1 for details.

The algorithms are described in

For more information on geodesics see geodesic.

Example of use:

Geod is a command-line utility providing access to the functionality of Geodesic and GeodesicLine.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
CAP_NONE 
CAP_C1 
CAP_C1p 
CAP_C2 
CAP_C3 
CAP_C4 
CAP_ALL 
OUT_ALL 

Bit masks for what calculations to do.

These masks do double duty. They signify to the GeodesicLine::GeodesicLine constructor and to Geodesic::Line what capabilities should be included in the GeodesicLine object. They also specify which results to return in the general routines Geodesic::GenDirect and Geodesic::GenInverse routines. GeodesicLine::mask is a duplication of this enum.

Enumerator:
NONE 

No capabilities, no output.

LATITUDE 

Calculate latitude lat2.

(It's not necessary to include this as a capability to GeodesicLine because this is included by default.)

LONGITUDE 

Calculate longitude lon2.

AZIMUTH 

Calculate azimuths azi1 and azi2.

(It's not necessary to include this as a capability to GeodesicLine because this is included by default.)

DISTANCE 

Calculate distance s12.

DISTANCE_IN 

Allow distance s12 to be used as input in the direct geodesic problem.

REDUCEDLENGTH 

Calculate reduced length m12.

GEODESICSCALE 

Calculate geodesic scales M12 and M21.

AREA 

Calculate area S12.

ALL 

All capabilities.

Calculate everything.


Constructor & Destructor Documentation

Constructor for a ellipsoid with.

Parameters:
[in]aequatorial radius (meters).
[in]fflattening of ellipsoid. Setting f = 0 gives a sphere. Negative f gives a prolate ellipsoid. If f > 1, set flattening to 1/f.

An exception is thrown if either of the axes of the ellipsoid is non-positive.


Member Function Documentation

Math::real GeographicLib::Geodesic::A1m1f ( real  eps) throw () [static, private]
Math::real GeographicLib::Geodesic::A2m1f ( real  eps) throw () [static, private]
void GeographicLib::Geodesic::A3coeff ( ) throw () [private]
Math::real GeographicLib::Geodesic::A3f ( real  eps) const throw () [private]
static real GeographicLib::Geodesic::AngNormalize ( real  x) throw () [inline, static, private]
static real GeographicLib::Geodesic::AngRound ( real  x) throw () [inline, static, private]
void GeographicLib::Geodesic::ArcDirect ( real  lat1,
real  lon1,
real  azi1,
real  a12,
real lat2,
real lon2,
real azi2,
real s12,
real m12,
real M12,
real M21,
real S12 
) const throw () [inline]

Perform the direct geodesic calculation where the length of the geodesic is specify in terms of arc length.

Parameters:
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]azi1azimuth at point 1 (degrees).
[in]a12arc length between point 1 and point 2 (degrees); it can be signed.
[out]lat2latitude of point 2 (degrees).
[out]lon2longitude of point 2 (degrees).
[out]azi2(forward) azimuth at point 2 (degrees).
[out]s12distance between point 1 and point 2 (meters).
[out]m12reduced length of geodesic (meters).
[out]M12geodesic scale of point 2 relative to point 1 (dimensionless).
[out]M21geodesic scale of point 1 relative to point 2 (dimensionless).
[out]S12area under the geodesic (meters2).

lat1 should be in the range [-90, 90]; lon1 and azi1 should be in the range [-180, 360]. The values of lon2 and azi2 returned are in the range [-180, 180).

If either point is at a pole, the azimuth is defined by keeping the longitude fixed and writing lat = 90 - eps or -90 + eps and taking the limit eps -> 0 from above. An arc length greater that 180 degrees signifies a geodesic which is not a shortest path. (For a prolate ellipsoid, an additional condition is necessary for a shortest path: the longitudinal extent must not exceed of 180 degrees.)

The following functions are overloaded versions of Geodesic::Direct which omit some of the output parameters.

void GeographicLib::Geodesic::ArcDirect ( real  lat1,
real  lon1,
real  azi1,
real  a12,
real lat2,
real lon2 
) const throw () [inline]

See the documentation for Geodesic::ArcDirect.

void GeographicLib::Geodesic::ArcDirect ( real  lat1,
real  lon1,
real  azi1,
real  a12,
real lat2,
real lon2,
real azi2 
) const throw () [inline]

See the documentation for Geodesic::ArcDirect.

void GeographicLib::Geodesic::ArcDirect ( real  lat1,
real  lon1,
real  azi1,
real  a12,
real lat2,
real lon2,
real azi2,
real s12 
) const throw () [inline]

See the documentation for Geodesic::ArcDirect.

void GeographicLib::Geodesic::ArcDirect ( real  lat1,
real  lon1,
real  azi1,
real  a12,
real lat2,
real lon2,
real azi2,
real s12,
real m12 
) const throw () [inline]

See the documentation for Geodesic::ArcDirect.

void GeographicLib::Geodesic::ArcDirect ( real  lat1,
real  lon1,
real  azi1,
real  a12,
real lat2,
real lon2,
real azi2,
real s12,
real M12,
real M21 
) const throw () [inline]

See the documentation for Geodesic::ArcDirect.

void GeographicLib::Geodesic::ArcDirect ( real  lat1,
real  lon1,
real  azi1,
real  a12,
real lat2,
real lon2,
real azi2,
real s12,
real m12,
real M12,
real M21 
) const throw () [inline]

See the documentation for Geodesic::ArcDirect.

Math::real GeographicLib::Geodesic::Astroid ( real  x,
real  y 
) throw () [static, private]
void GeographicLib::Geodesic::C1f ( real  eps,
real  c[] 
) throw () [static, private]
void GeographicLib::Geodesic::C1pf ( real  eps,
real  c[] 
) throw () [static, private]
void GeographicLib::Geodesic::C2f ( real  eps,
real  c[] 
) throw () [static, private]
void GeographicLib::Geodesic::C3coeff ( ) throw () [private]
void GeographicLib::Geodesic::C3f ( real  eps,
real  c[] 
) const throw () [private]
void GeographicLib::Geodesic::C4coeff ( ) throw () [private]
void GeographicLib::Geodesic::C4f ( real  k2,
real  c[] 
) const throw () [private]
Math::real GeographicLib::Geodesic::Direct ( real  lat1,
real  lon1,
real  azi1,
real  s12,
real lat2,
real lon2,
real azi2,
real m12,
real M12,
real M21,
real S12 
) const throw () [inline]

Perform the direct geodesic calculation where the length of the geodesic is specify in terms of distance.

Parameters:
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]azi1azimuth at point 1 (degrees).
[in]s12distance between point 1 and point 2 (meters); it can be signed.
[out]lat2latitude of point 2 (degrees).
[out]lon2longitude of point 2 (degrees).
[out]azi2(forward) azimuth at point 2 (degrees).
[out]m12reduced length of geodesic (meters).
[out]M12geodesic scale of point 2 relative to point 1 (dimensionless).
[out]M21geodesic scale of point 1 relative to point 2 (dimensionless).
[out]S12area under the geodesic (meters2).
Returns:
a12 arc length of between point 1 and point 2 (degrees).

lat1 should be in the range [-90, 90]; lon1 and azi1 should be in the range [-180, 360]. The values of lon2 and azi2 returned are in the range [-180, 180).

If either point is at a pole, the azimuth is defined by keeping the longitude fixed and writing lat = 90 - eps or -90 + eps and taking the limit eps -> 0 from above. An arc length greater that 180 degrees signifies a geodesic which is not a shortest path. (For a prolate ellipsoid, an additional condition is necessary for a shortest path: the longitudinal extent must not exceed of 180 degrees.)

The following functions are overloaded versions of Geodesic::Direct which omit some of the output parameters. Note, however, that the arc length is always computed and returned as the function value.

Math::real GeographicLib::Geodesic::Direct ( real  lat1,
real  lon1,
real  azi1,
real  s12,
real lat2,
real lon2 
) const throw () [inline]

See the documentation for Geodesic::Direct.

Math::real GeographicLib::Geodesic::Direct ( real  lat1,
real  lon1,
real  azi1,
real  s12,
real lat2,
real lon2,
real azi2 
) const throw () [inline]

See the documentation for Geodesic::Direct.

Math::real GeographicLib::Geodesic::Direct ( real  lat1,
real  lon1,
real  azi1,
real  s12,
real lat2,
real lon2,
real azi2,
real m12 
) const throw () [inline]

See the documentation for Geodesic::Direct.

Math::real GeographicLib::Geodesic::Direct ( real  lat1,
real  lon1,
real  azi1,
real  s12,
real lat2,
real lon2,
real azi2,
real M12,
real M21 
) const throw () [inline]

See the documentation for Geodesic::Direct.

Math::real GeographicLib::Geodesic::Direct ( real  lat1,
real  lon1,
real  azi1,
real  s12,
real lat2,
real lon2,
real azi2,
real m12,
real M12,
real M21 
) const throw () [inline]

See the documentation for Geodesic::Direct.

Returns:
total area of ellipsoid in meters2. The area of a polygon encircling a pole can be found by adding Geodesic::EllipsoidArea()/2 to the sum of S12 for each side of the polygon.
Math::real GeographicLib::Geodesic::Flattening ( ) const throw () [inline]
Returns:
f the flattening of the ellipsoid. This is the value used in the constructor.
Math::real GeographicLib::Geodesic::GenDirect ( real  lat1,
real  lon1,
real  azi1,
bool  arcmode,
real  s12_a12,
unsigned  outmask,
real lat2,
real lon2,
real azi2,
real s12,
real m12,
real M12,
real M21,
real S12 
) const throw ()

The general direct geodesic calculation.

Geodesic::Direct and Geodesic::ArcDirect are defined in terms of this function.

Parameters:
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]azi1azimuth at point 1 (degrees).
[in]arcmodeboolean flag determining the meaning of the second parameter.
[in]s12_a12if arcmode is false, this is the distance between point 1 and point 2 (meters); otherwise it is the arc length between point 1 and point 2 (degrees); it can be signed.
[in]outmaska bitor'ed combination of Geodesic::mask values specifying which of the following parameters should be set.
[out]lat2latitude of point 2 (degrees).
[out]lon2longitude of point 2 (degrees).
[out]azi2(forward) azimuth at point 2 (degrees).
[out]s12distance between point 1 and point 2 (meters).
[out]m12reduced length of geodesic (meters).
[out]M12geodesic scale of point 2 relative to point 1 (dimensionless).
[out]M21geodesic scale of point 1 relative to point 2 (dimensionless).
[out]S12area under the geodesic (meters2).
Returns:
a12 arc length of between point 1 and point 2 (degrees).

The Geodesic::mask values possible for outmask are

The function value a12 is always computed and returned and this equals s12_a12 is arcmode is true. If outmask includes Geodesic::DISTANCE and arcmode is false, then s12 = s12_a12. It is not necessary to include Geodesic::DISTANCE_IN in outmask; this is automatically included is arcmode is false.

Math::real GeographicLib::Geodesic::GenInverse ( real  lat1,
real  lon1,
real  lat2,
real  lon2,
unsigned  outmask,
real s12,
real azi1,
real azi2,
real m12,
real M12,
real M21,
real S12 
) const throw ()

The general inverse geodesic calculation.

Geodesic::Inverse is defined in terms of this function.

Parameters:
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]lat2latitude of point 2 (degrees).
[in]lon2longitude of point 2 (degrees).
[in]outmaska bitor'ed combination of Geodesic::mask values specifying which of the following parameters should be set.
[out]s12distance between point 1 and point 2 (meters).
[out]azi1azimuth at point 1 (degrees).
[out]azi2(forward) azimuth at point 2 (degrees).
[out]m12reduced length of geodesic (meters).
[out]M12geodesic scale of point 2 relative to point 1 (dimensionless).
[out]M21geodesic scale of point 1 relative to point 2 (dimensionless).
[out]S12area under the geodesic (meters2).
Returns:
a12 arc length of between point 1 and point 2 (degrees).

The Geodesic::mask values possible for outmask are

The arc length is always computed and returned as the function value.

Math::real GeographicLib::Geodesic::Inverse ( real  lat1,
real  lon1,
real  lat2,
real  lon2,
real s12,
real azi1,
real azi2,
real m12,
real M12,
real M21,
real S12 
) const throw () [inline]

Perform the inverse geodesic calculation.

Parameters:
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]lat2latitude of point 2 (degrees).
[in]lon2longitude of point 2 (degrees).
[out]s12distance between point 1 and point 2 (meters).
[out]azi1azimuth at point 1 (degrees).
[out]azi2(forward) azimuth at point 2 (degrees).
[out]m12reduced length of geodesic (meters).
[out]M12geodesic scale of point 2 relative to point 1 (dimensionless).
[out]M21geodesic scale of point 1 relative to point 2 (dimensionless).
[out]S12area under the geodesic (meters2).
Returns:
a12 arc length of between point 1 and point 2 (degrees).

lat1 and lat2 should be in the range [-90, 90]; lon1 and lon2 should be in the range [-180, 360]. The values of azi1 and azi2 returned are in the range [-180, 180).

If either point is at a pole, the azimuth is defined by keeping the longitude fixed and writing lat = 90 - eps or -90 + eps and taking the limit eps -> 0 from above. If the routine fails to converge, then all the requested outputs are set to Math::NaN(). (Test for such results with Math::isnan.) This is not expected to happen with ellipsoidal models of the earth; please report all cases where this occurs.

The following functions are overloaded versions of Geodesic::Inverse which omit some of the output parameters. Note, however, that the arc length is always computed and returned as the function value.

Math::real GeographicLib::Geodesic::Inverse ( real  lat1,
real  lon1,
real  lat2,
real  lon2,
real s12 
) const throw () [inline]

See the documentation for Geodesic::Inverse.

Math::real GeographicLib::Geodesic::Inverse ( real  lat1,
real  lon1,
real  lat2,
real  lon2,
real azi1,
real azi2 
) const throw () [inline]

See the documentation for Geodesic::Inverse.

Math::real GeographicLib::Geodesic::Inverse ( real  lat1,
real  lon1,
real  lat2,
real  lon2,
real s12,
real azi1,
real azi2 
) const throw () [inline]

See the documentation for Geodesic::Inverse.

Math::real GeographicLib::Geodesic::Inverse ( real  lat1,
real  lon1,
real  lat2,
real  lon2,
real s12,
real azi1,
real azi2,
real m12 
) const throw () [inline]

See the documentation for Geodesic::Inverse.

Math::real GeographicLib::Geodesic::Inverse ( real  lat1,
real  lon1,
real  lat2,
real  lon2,
real s12,
real azi1,
real azi2,
real M12,
real M21 
) const throw () [inline]

See the documentation for Geodesic::Inverse.

Math::real GeographicLib::Geodesic::Inverse ( real  lat1,
real  lon1,
real  lat2,
real  lon2,
real s12,
real azi1,
real azi2,
real m12,
real M12,
real M21 
) const throw () [inline]

See the documentation for Geodesic::Inverse.

Math::real GeographicLib::Geodesic::InverseStart ( real  sbet1,
real  cbet1,
real  sbet2,
real  cbet2,
real  lam12,
real salp1,
real calp1,
real salp2,
real calp2,
real  C1a[],
real  C2a[] 
) const throw () [private]
Math::real GeographicLib::Geodesic::Lambda12 ( real  sbet1,
real  cbet1,
real  sbet2,
real  cbet2,
real  salp1,
real  calp1,
real salp2,
real calp2,
real sig12,
real ssig1,
real csig1,
real ssig2,
real csig2,
real eps,
real domg12,
bool  diffp,
real dlam12,
real  C1a[],
real  C2a[],
real  C3a[] 
) const throw () [private]
void GeographicLib::Geodesic::Lengths ( real  eps,
real  sig12,
real  ssig1,
real  csig1,
real  ssig2,
real  csig2,
real  cbet1,
real  cbet2,
real s12s,
real m12a,
real m0,
bool  scalep,
real M12,
real M21,
real  C1a[],
real  C2a[] 
) const throw () [private]
GeodesicLine GeographicLib::Geodesic::Line ( real  lat1,
real  lon1,
real  azi1,
unsigned  caps = ALL 
) const throw ()

Set up to compute several points on a singe geodesic.

Parameters:
[in]lat1latitude of point 1 (degrees).
[in]lon1longitude of point 1 (degrees).
[in]azi1azimuth at point 1 (degrees).
[in]capsbitor'ed combination of Geodesic::mask values specifying the capabilities the GeodesicLine object should possess, i.e., which quantities can be returned in calls to GeodesicLib::Position.

lat1 should be in the range [-90, 90]; lon1 and azi1 should be in the range [-180, 360].

The Geodesic::mask values are

The default value of caps is Geodesic::ALL which turns on all the capabilities.

If the point is at a pole, the azimuth is defined by keeping the lon1 fixed and writing lat1 = 90 - eps or -90 + eps and taking the limit eps -> 0 from above.

Math::real GeographicLib::Geodesic::MajorRadius ( ) const throw () [inline]
Returns:
a the equatorial radius of the ellipsoid (meters). This is the value used in the constructor.
static void GeographicLib::Geodesic::SinCosNorm ( real sinx,
real cosx 
) throw () [inline, static, private]
Math::real GeographicLib::Geodesic::SinCosSeries ( bool  sinp,
real  sinx,
real  cosx,
const real  c[],
int  n 
) throw () [static, private]

Friends And Related Function Documentation

friend class GeodesicLine [friend]

Member Data Documentation

const unsigned GeographicLib::Geodesic::maxit_ = 50 [static, private]
const int GeographicLib::Geodesic::nA1_ = GEOD_ORD [static, private]
const int GeographicLib::Geodesic::nA2_ = GEOD_ORD [static, private]
const int GeographicLib::Geodesic::nA3_ = GEOD_ORD [static, private]
const int GeographicLib::Geodesic::nA3x_ = nA3_ [static, private]
const int GeographicLib::Geodesic::nC1_ = GEOD_ORD [static, private]
const int GeographicLib::Geodesic::nC1p_ = GEOD_ORD [static, private]
const int GeographicLib::Geodesic::nC2_ = GEOD_ORD [static, private]
const int GeographicLib::Geodesic::nC3_ = GEOD_ORD [static, private]
const int GeographicLib::Geodesic::nC3x_ = (nC3_ * (nC3_ - 1)) / 2 [static, private]
const int GeographicLib::Geodesic::nC4_ = GEOD_ORD [static, private]
const int GeographicLib::Geodesic::nC4x_ = (nC4_ * (nC4_ + 1)) / 2 [static, private]
const Math::real GeographicLib::Geodesic::tiny_ = sqrt(numeric_limits<real>::min()) [static, private]
const Math::real GeographicLib::Geodesic::tol0_ = numeric_limits<real>::epsilon() [static, private]
const Math::real GeographicLib::Geodesic::tol1_ = 200 * tol0_ [static, private]
const Math::real GeographicLib::Geodesic::tol2_ = sqrt(numeric_limits<real>::epsilon()) [static, private]

A global instantiation of Geodesic with the parameters for the WGS84 ellipsoid.

const Math::real GeographicLib::Geodesic::xthresh_ = 1000 * tol2_ [static, private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines