Updraft
1.0
Open source glider flight visualisation tool.
|
Geodesic calculations More...
#include <Geodesic.hpp>
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 |
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:
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
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.
typedef Math::real GeographicLib::Geodesic::real [private] |
enum GeographicLib::Geodesic::captype [private] |
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.
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. |
GeographicLib::Geodesic::Geodesic | ( | real | a, |
real | f | ||
) |
Constructor for a ellipsoid with.
[in] | a | equatorial radius (meters). |
[in] | f | flattening 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.
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.
[in] | lat1 | latitude of point 1 (degrees). |
[in] | lon1 | longitude of point 1 (degrees). |
[in] | azi1 | azimuth at point 1 (degrees). |
[in] | a12 | arc length between point 1 and point 2 (degrees); it can be signed. |
[out] | lat2 | latitude of point 2 (degrees). |
[out] | lon2 | longitude of point 2 (degrees). |
[out] | azi2 | (forward) azimuth at point 2 (degrees). |
[out] | s12 | distance between point 1 and point 2 (meters). |
[out] | m12 | reduced length of geodesic (meters). |
[out] | M12 | geodesic scale of point 2 relative to point 1 (dimensionless). |
[out] | M21 | geodesic scale of point 1 relative to point 2 (dimensionless). |
[out] | S12 | area 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.
[in] | lat1 | latitude of point 1 (degrees). |
[in] | lon1 | longitude of point 1 (degrees). |
[in] | azi1 | azimuth at point 1 (degrees). |
[in] | s12 | distance between point 1 and point 2 (meters); it can be signed. |
[out] | lat2 | latitude of point 2 (degrees). |
[out] | lon2 | longitude of point 2 (degrees). |
[out] | azi2 | (forward) azimuth at point 2 (degrees). |
[out] | m12 | reduced length of geodesic (meters). |
[out] | M12 | geodesic scale of point 2 relative to point 1 (dimensionless). |
[out] | M21 | geodesic scale of point 1 relative to point 2 (dimensionless). |
[out] | S12 | area 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. 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.
Math::real GeographicLib::Geodesic::EllipsoidArea | ( | ) | const throw () [inline] |
Math::real GeographicLib::Geodesic::Flattening | ( | ) | const throw () [inline] |
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.
[in] | lat1 | latitude of point 1 (degrees). |
[in] | lon1 | longitude of point 1 (degrees). |
[in] | azi1 | azimuth at point 1 (degrees). |
[in] | arcmode | boolean flag determining the meaning of the second parameter. |
[in] | s12_a12 | if 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] | outmask | a bitor'ed combination of Geodesic::mask values specifying which of the following parameters should be set. |
[out] | lat2 | latitude of point 2 (degrees). |
[out] | lon2 | longitude of point 2 (degrees). |
[out] | azi2 | (forward) azimuth at point 2 (degrees). |
[out] | s12 | distance between point 1 and point 2 (meters). |
[out] | m12 | reduced length of geodesic (meters). |
[out] | M12 | geodesic scale of point 2 relative to point 1 (dimensionless). |
[out] | M21 | geodesic scale of point 1 relative to point 2 (dimensionless). |
[out] | S12 | area under the geodesic (meters2). |
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.
[in] | lat1 | latitude of point 1 (degrees). |
[in] | lon1 | longitude of point 1 (degrees). |
[in] | lat2 | latitude of point 2 (degrees). |
[in] | lon2 | longitude of point 2 (degrees). |
[in] | outmask | a bitor'ed combination of Geodesic::mask values specifying which of the following parameters should be set. |
[out] | s12 | distance between point 1 and point 2 (meters). |
[out] | azi1 | azimuth at point 1 (degrees). |
[out] | azi2 | (forward) azimuth at point 2 (degrees). |
[out] | m12 | reduced length of geodesic (meters). |
[out] | M12 | geodesic scale of point 2 relative to point 1 (dimensionless). |
[out] | M21 | geodesic scale of point 1 relative to point 2 (dimensionless). |
[out] | S12 | area under the geodesic (meters2). |
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.
[in] | lat1 | latitude of point 1 (degrees). |
[in] | lon1 | longitude of point 1 (degrees). |
[in] | lat2 | latitude of point 2 (degrees). |
[in] | lon2 | longitude of point 2 (degrees). |
[out] | s12 | distance between point 1 and point 2 (meters). |
[out] | azi1 | azimuth at point 1 (degrees). |
[out] | azi2 | (forward) azimuth at point 2 (degrees). |
[out] | m12 | reduced length of geodesic (meters). |
[out] | M12 | geodesic scale of point 2 relative to point 1 (dimensionless). |
[out] | M21 | geodesic scale of point 1 relative to point 2 (dimensionless). |
[out] | S12 | area under the geodesic (meters2). |
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.
[in] | lat1 | latitude of point 1 (degrees). |
[in] | lon1 | longitude of point 1 (degrees). |
[in] | azi1 | azimuth at point 1 (degrees). |
[in] | caps | bitor'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] |
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] |
friend class GeodesicLine [friend] |
real GeographicLib::Geodesic::_a [private] |
real GeographicLib::Geodesic::_A3x[nA3x_] [private] |
real GeographicLib::Geodesic::_b [private] |
real GeographicLib::Geodesic::_c2 [private] |
real GeographicLib::Geodesic::_C3x[nC3x_] [private] |
real GeographicLib::Geodesic::_C4x[nC4x_] [private] |
real GeographicLib::Geodesic::_e2 [private] |
real GeographicLib::Geodesic::_ep2 [private] |
real GeographicLib::Geodesic::_etol2 [private] |
real GeographicLib::Geodesic::_f [private] |
real GeographicLib::Geodesic::_f1 [private] |
real GeographicLib::Geodesic::_n [private] |
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] |
const Geodesic GeographicLib::Geodesic::WGS84 [static] |
A global instantiation of Geodesic with the parameters for the WGS84 ellipsoid.
const Math::real GeographicLib::Geodesic::xthresh_ = 1000 * tol2_ [static, private] |