| EllipticFunction.hpp | | EllipticFunction.hpp | |
| | | | |
| skipping to change at line 46 | | skipping to change at line 46 | |
| * In geodesic applications, it is convenient to separate the incomplete | | * In geodesic applications, it is convenient to separate the incomplete | |
| * integrals into secular and periodic components, e.g., | | * integrals into secular and periodic components, e.g., | |
| * \f[ | | * \f[ | |
| * E(\phi, k) = (2 E(\phi) / \pi) [ \phi + \delta E(\phi, k) ] | | * E(\phi, k) = (2 E(\phi) / \pi) [ \phi + \delta E(\phi, k) ] | |
| * \f] | | * \f] | |
| * where δ\e E(φ, \e k) is an odd periodic function with period | | * where δ\e E(φ, \e k) is an odd periodic function with period | |
| * π. | | * π. | |
| * | | * | |
| * The computation of the elliptic integrals uses the algorithms given in | | * The computation of the elliptic integrals uses the algorithms given in | |
| * - B. C. Carlson, | | * - B. C. Carlson, | |
|
| * <a href="http://dx.doi.org/10.1007/BF02198293"> Computation of ellip | | * <a href="http://dx.doi.org/10.1007/BF02198293"> Computation of real | |
| tic | | or | |
| * integrals</a>, Numerical Algorithms 10, 13--26 (1995) | | * complex elliptic integrals</a>, Numerical Algorithms 10, 13--26 (199 | |
| | | 5) | |
| * . | | * . | |
| * with the additional optimizations given in http://dlmf.nist.gov/19.36.
i. | | * with the additional optimizations given in http://dlmf.nist.gov/19.36.
i. | |
| * The computation of the Jacobi elliptic functions uses the algorithm gi
ven | | * The computation of the Jacobi elliptic functions uses the algorithm gi
ven | |
| * in | | * in | |
| * - R. Bulirsch, | | * - R. Bulirsch, | |
| * <a href="http://dx.doi.org/10.1007/BF01397975"> Numerical Calculatio
n of | | * <a href="http://dx.doi.org/10.1007/BF01397975"> Numerical Calculatio
n of | |
| * Elliptic Integrals and Elliptic Functions</a>, Numericshe Mathematik
7, | | * Elliptic Integrals and Elliptic Functions</a>, Numericshe Mathematik
7, | |
| * 78--90 (1965). | | * 78--90 (1965). | |
| * . | | * . | |
| * The notation follows http://dlmf.nist.gov/19 and http://dlmf.nist.gov/
22 | | * The notation follows http://dlmf.nist.gov/19 and http://dlmf.nist.gov/
22 | |
| | | | |
| skipping to change at line 89 | | skipping to change at line 89 | |
| /** | | /** | |
| * Constructor specifying the modulus and parameter. | | * Constructor specifying the modulus and parameter. | |
| * | | * | |
| * @param[in] k2 the square of the modulus <i>k</i><sup>2</sup>. | | * @param[in] k2 the square of the modulus <i>k</i><sup>2</sup>. | |
| * <i>k</i><sup>2</sup> must lie in (-∞, 1). (No checking is | | * <i>k</i><sup>2</sup> must lie in (-∞, 1). (No checking is | |
| * done.) | | * done.) | |
| * @param[in] alpha2 the parameter α<sup>2</sup>. | | * @param[in] alpha2 the parameter α<sup>2</sup>. | |
| * α<sup>2</sup> must lie in (-∞, 1). (No checking is do
ne.) | | * α<sup>2</sup> must lie in (-∞, 1). (No checking is do
ne.) | |
| * | | * | |
| * If only elliptic integrals of the first and second kinds are needed, | | * If only elliptic integrals of the first and second kinds are needed, | |
|
| * then set α<sup>2</sup> = 0 (in which case we have Π(φ, | | * then set α<sup>2</sup> = 0 (the default value); in this case, | |
| 0, | | we | |
| * \e k) = \e F(φ, \e k), \e G(φ, 0, \e k) = \e E(φ, \e k)) | | * have Π(φ, 0, \e k) = \e F(φ, \e k), \e G(φ, 0, \e k) | |
| , | | = \e | |
| * and \e H(φ, 0, \e k) = \e F(φ, \e k) - \e D(φ, \e k). | | * E(φ, \e k), and \e H(φ, 0, \e k) = \e F(φ, \e k) - \e | |
| | | * D(φ, \e k). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
|
| EllipticFunction(real k2, real alpha2) throw(); | | EllipticFunction(real k2 = 0, real alpha2 = 0) throw(); | |
| | | | |
| /** | | /** | |
| * Constructor specifying the modulus and parameter and their complemen
ts. | | * Constructor specifying the modulus and parameter and their complemen
ts. | |
| * | | * | |
| * @param[in] k2 the square of the modulus <i>k</i><sup>2</sup>. | | * @param[in] k2 the square of the modulus <i>k</i><sup>2</sup>. | |
| * <i>k</i><sup>2</sup> must lie in (-∞, 1). (No checking is | | * <i>k</i><sup>2</sup> must lie in (-∞, 1). (No checking is | |
| * done.) | | * done.) | |
| * @param[in] alpha2 the parameter α<sup>2</sup>. | | * @param[in] alpha2 the parameter α<sup>2</sup>. | |
| * α<sup>2</sup> must lie in (-∞, 1). (No checking is do
ne.) | | * α<sup>2</sup> must lie in (-∞, 1). (No checking is do
ne.) | |
| * @param[in] kp2 the complementary modulus squared <i>k'</i><sup>2</su
p> = | | * @param[in] kp2 the complementary modulus squared <i>k'</i><sup>2</su
p> = | |
| | | | |
| skipping to change at line 116 | | skipping to change at line 117 | |
| * − α<sup>2</sup>. | | * − α<sup>2</sup>. | |
| * | | * | |
| * The arguments must satisfy \e k2 + \e kp2 = 1 and \e alpha2 + \e alp
hap2 | | * The arguments must satisfy \e k2 + \e kp2 = 1 and \e alpha2 + \e alp
hap2 | |
| * = 1. (No checking is done that these conditions are met.) This | | * = 1. (No checking is done that these conditions are met.) This | |
| * constructor is provided to enable accuracy to be maintained, e.g., w
hen | | * constructor is provided to enable accuracy to be maintained, e.g., w
hen | |
| * \e k is very close to unity. | | * \e k is very close to unity. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| EllipticFunction(real k2, real alpha2, real kp2, real alphap2) throw(); | | EllipticFunction(real k2, real alpha2, real kp2, real alphap2) throw(); | |
| | | | |
| /** | | /** | |
|
| * Constructor specifying the modulus only. | | | |
| * | | | |
| * @param[in] k2 the square of the modulus <i>k</i><sup>2</sup>. | | | |
| * <i>k</i><sup>2</sup> must lie in (-∞, 1). (No checking is | | | |
| * done.) | | | |
| * | | | |
| * <b>COMPATIBILITY NOTE:</b> This constructor calls EllipticFunction(r | | | |
| eal, | | | |
| * real) with a 2nd argument of 0. At some point, EllipticFunction(rea | | | |
| l) | | | |
| * and will be withdrawn and the interface to EllipticFunction(real, re | | | |
| al) | | | |
| * changed so that its 2nd argument defaults to 0. This will preserve | | | |
| * source-level compatibility. | | | |
| ********************************************************************** | | | |
| / | | | |
| explicit EllipticFunction(real k2 = 0) throw(); | | | |
| | | | |
| /** | | | |
| * Reset the modulus and parameter. | | * Reset the modulus and parameter. | |
| * | | * | |
| * @param[in] k2 the new value of square of the modulus | | * @param[in] k2 the new value of square of the modulus | |
| * <i>k</i><sup>2</sup> which must lie in (-∞, 1). (No checkin
g is | | * <i>k</i><sup>2</sup> which must lie in (-∞, 1). (No checkin
g is | |
| * done.) | | * done.) | |
| * @param[in] alpha2 the new value of parameter α<sup>2</sup>. | | * @param[in] alpha2 the new value of parameter α<sup>2</sup>. | |
| * α<sup>2</sup> must lie in (-∞, 1). (No checking is do
ne.) | | * α<sup>2</sup> must lie in (-∞, 1). (No checking is do
ne.) | |
| **********************************************************************
/ | | **********************************************************************
/ | |
|
| void Reset(real k2, real alpha2 = 0) throw() | | void Reset(real k2 = 0, real alpha2 = 0) throw() | |
| { Reset(k2, alpha2, 1 - k2, 1 - alpha2); } | | { Reset(k2, alpha2, 1 - k2, 1 - alpha2); } | |
| | | | |
| /** | | /** | |
| * Reset the modulus and parameter supplying also their complements. | | * Reset the modulus and parameter supplying also their complements. | |
| * | | * | |
| * @param[in] k2 the square of the modulus <i>k</i><sup>2</sup>. | | * @param[in] k2 the square of the modulus <i>k</i><sup>2</sup>. | |
| * <i>k</i><sup>2</sup> must lie in (-∞, 1). (No checking is | | * <i>k</i><sup>2</sup> must lie in (-∞, 1). (No checking is | |
| * done.) | | * done.) | |
| * @param[in] alpha2 the parameter α<sup>2</sup>. | | * @param[in] alpha2 the parameter α<sup>2</sup>. | |
| * α<sup>2</sup> must lie in (-∞, 1). (No checking is do
ne.) | | * α<sup>2</sup> must lie in (-∞, 1). (No checking is do
ne.) | |
| | | | |
| skipping to change at line 188 | | skipping to change at line 174 | |
| /** | | /** | |
| * @return the parameter α<sup>2</sup>. | | * @return the parameter α<sup>2</sup>. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real alpha2() const throw() { return _alpha2; } | | Math::real alpha2() const throw() { return _alpha2; } | |
| | | | |
| /** | | /** | |
| * @return the complementary parameter α'<sup>2</sup> = 1 − | | * @return the complementary parameter α'<sup>2</sup> = 1 − | |
| * α<sup>2</sup>. | | * α<sup>2</sup>. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real alphap2() const throw() { return _alphap2; } | | Math::real alphap2() const throw() { return _alphap2; } | |
|
| | | ///@} | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * @return the square of the modulus <i>k</i><sup>2</sup>. | | * @return the square of the modulus <i>k</i><sup>2</sup>. | |
| * | | * | |
| * <b>DEPRECATED</b>, use k2() instead. | | * <b>DEPRECATED</b>, use k2() instead. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real m() const throw() { return _k2; } | | Math::real m() const throw() { return _k2; } | |
|
| | | | |
| /** | | /** | |
| * @return the square of the complementary modulus <i>k'</i><sup>2</sup
> = | | * @return the square of the complementary modulus <i>k'</i><sup>2</sup
> = | |
| * 1 − <i>k</i><sup>2</sup>. | | * 1 − <i>k</i><sup>2</sup>. | |
| * | | * | |
| * <b>DEPRECATED</b>, use kp2() instead. | | * <b>DEPRECATED</b>, use kp2() instead. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real m1() const throw() { return _kp2; } | | Math::real m1() const throw() { return _kp2; } | |
|
| ///@} | | /// \endcond | |
| | | | |
| /** \name Complete elliptic integrals. | | /** \name Complete elliptic integrals. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| /** | | /** | |
| * The complete integral of the first kind. | | * The complete integral of the first kind. | |
| * | | * | |
| * @return \e K(\e k). | | * @return \e K(\e k). | |
| * | | * | |
| * \e K(\e k) is defined in http://dlmf.nist.gov/19.2.E4 | | * \e K(\e k) is defined in http://dlmf.nist.gov/19.2.E4 | |
| | | | |
End of changes. 9 change blocks. |
| 31 lines changed or deleted | | 15 lines changed or added | |
|
| Geodesic.hpp | | Geodesic.hpp | |
| /** | | /** | |
| * \file Geodesic.hpp | | * \file Geodesic.hpp | |
| * \brief Header for GeographicLib::Geodesic class | | * \brief Header for GeographicLib::Geodesic class | |
| * | | * | |
|
| * Copyright (c) Charles Karney (2009-2012) <charles@karney.com> and licens
ed | | * Copyright (c) Charles Karney (2009-2013) <charles@karney.com> and licens
ed | |
| * under the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_GEODESIC_HPP) | | #if !defined(GEOGRAPHICLIB_GEODESIC_HPP) | |
| #define GEOGRAPHICLIB_GEODESIC_HPP 1 | | #define GEOGRAPHICLIB_GEODESIC_HPP 1 | |
| | | | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| | | | |
| #if !defined(GEOGRAPHICLIB_GEODESIC_ORDER) | | #if !defined(GEOGRAPHICLIB_GEODESIC_ORDER) | |
| | | | |
| skipping to change at line 55 | | skipping to change at line 55 | |
| * azi2, and \e s12. This is the \e inverse geodesic problem, whose solu
tion | | * azi2, and \e s12. This is the \e inverse geodesic problem, whose solu
tion | |
| * is given by Geodesic::Inverse. Usually, the solution to the inverse | | * is given by Geodesic::Inverse. Usually, the solution to the inverse | |
| * problem is unique. In cases where there are multiple solutions (all w
ith | | * problem is unique. In cases where there are multiple solutions (all w
ith | |
| * the same \e s12, of course), all the solutions can be easily generated | | * the same \e s12, of course), all the solutions can be easily generated | |
| * once a particular solution is provided. | | * once a particular solution is provided. | |
| * | | * | |
| * The standard way of specifying the direct problem is the specify the | | * The standard way of specifying the direct problem is the specify the | |
| * distance \e s12 to the second point. However it is sometimes useful | | * distance \e s12 to the second point. However it is sometimes useful | |
| * instead to specify the arc length \e a12 (in degrees) on the auxiliary | | * instead to specify the arc length \e a12 (in degrees) on the auxiliary | |
| * sphere. This is a mathematical construct used in solving the geodesic | | * sphere. This is a mathematical construct used in solving the geodesic | |
|
| * problems. The solution of the direct problem in this form is provide | | * problems. The solution of the direct problem in this form is provided | |
| by | | by | |
| * Geodesic::ArcDirect. An arc length in excess of 180° indicates | | * Geodesic::ArcDirect. An arc length in excess of 180° indicates th | |
| * that the geodesic is not a shortest path. In addition, the arc length | | at | |
| * between an equatorial crossing and the next extremum of latitude for a | | * the geodesic is not a shortest path. In addition, the arc length betw | |
| * geodesic is 90°. | | een | |
| | | * an equatorial crossing and the next extremum of latitude for a geodesi | |
| | | c is | |
| | | * 90°. | |
| * | | * | |
| * This class can also calculate several other quantities related to | | * This class can also calculate several other quantities related to | |
| * geodesics. These are: | | * geodesics. These are: | |
| * - <i>reduced length</i>. If we fix the first point and increase \e az
i1 | | * - <i>reduced length</i>. If we fix the first point and increase \e az
i1 | |
| * by \e dazi1 (radians), the second point is displaced \e m12 \e dazi1
in | | * by \e dazi1 (radians), the second point is displaced \e m12 \e dazi1
in | |
| * the direction \e azi2 + 90°. The quantity \e m12 is called | | * the direction \e azi2 + 90°. The quantity \e m12 is called | |
| * the "reduced length" and is symmetric under interchange of the two | | * the "reduced length" and is symmetric under interchange of the two | |
| * points. On a curved surface the reduced length obeys a symmetry | | * points. On a curved surface the reduced length obeys a symmetry | |
| * relation, \e m12 + \e m21 = 0. On a flat surface, we have \e m12 =
\e | | * relation, \e m12 + \e m21 = 0. On a flat surface, we have \e m12 =
\e | |
| * s12. The ratio <i>s12</i>/\e m12 gives the azimuthal scale for an | | * s12. The ratio <i>s12</i>/\e m12 gives the azimuthal scale for an | |
| * azimuthal equidistant projection. | | * azimuthal equidistant projection. | |
| * - <i>geodesic scale</i>. Consider a reference geodesic and a second | | * - <i>geodesic scale</i>. Consider a reference geodesic and a second | |
| * geodesic parallel to this one at point 1 and separated by a small | | * geodesic parallel to this one at point 1 and separated by a small | |
| * distance \e dt. The separation of the two geodesics at point 2 is \
e | | * distance \e dt. The separation of the two geodesics at point 2 is \
e | |
| * M12 \e dt where \e M12 is called the "geodesic scale". \e M21 is | | * M12 \e dt where \e M12 is called the "geodesic scale". \e M21 is | |
| * defined similarly (with the geodesics being parallel at point 2). O
n a | | * defined similarly (with the geodesics being parallel at point 2). O
n a | |
| * flat surface, we have \e M12 = \e M21 = 1. The quantity 1/\e M12 gi
ves | | * flat surface, we have \e M12 = \e M21 = 1. The quantity 1/\e M12 gi
ves | |
| * the scale of the Cassini-Soldner projection. | | * the scale of the Cassini-Soldner projection. | |
|
| * - <i>area</i>. Consider the quadrilateral bounded by the following li | | | |
| nes: | | * - <i>area</i>. The area between the geodesic from point 1 to point 2 | |
| * the geodesic from point 1 to point 2, the meridian from point 2 to t | | and | |
| he | | * the equation is represented by \e S12; it is the area, measured | |
| * equator, the equator from \e lon2 to \e lon1, the meridian from the | | * counter-clockwise, of the geodesic quadrilateral with corners | |
| * equator to point 1. The area of this quadrilateral is represented b | | * (<i>lat1</i>,<i>lon1</i>), (0,<i>lon1</i>), (0,<i>lon2</i>), and | |
| y \e | | * (<i>lat2</i>,<i>lon2</i>). It can be used to compute the area of an | |
| * S12 with a clockwise traversal of the perimeter counting as a positi | | y | |
| ve | | * simple geodesic polygon. | |
| * area and it can be used to compute the area of any simple geodesic | | | |
| * polygon. | | | |
| * | | * | |
| * Overloaded versions of Geodesic::Direct, Geodesic::ArcDirect, and | | * Overloaded versions of Geodesic::Direct, Geodesic::ArcDirect, and | |
| * Geodesic::Inverse allow these quantities to be returned. In addition | | * Geodesic::Inverse allow these quantities to be returned. In addition | |
| * there are general functions Geodesic::GenDirect, and Geodesic::GenInve
rse | | * there are general functions Geodesic::GenDirect, and Geodesic::GenInve
rse | |
| * which allow an arbitrary set of results to be computed. The quantitie
s \e | | * which allow an arbitrary set of results to be computed. The quantitie
s \e | |
| * m12, \e M12, \e M21 which all specify the behavior of nearby geodesics | | * m12, \e M12, \e M21 which all specify the behavior of nearby geodesics | |
| * obey addition rules. If points 1, 2, and 3 all lie on a single geodes
ic, | | * obey addition rules. If points 1, 2, and 3 all lie on a single geodes
ic, | |
| * then the following rules hold: | | * then the following rules hold: | |
| * - \e s13 = \e s12 + \e s23 | | * - \e s13 = \e s12 + \e s23 | |
| * - \e a13 = \e a12 + \e a23 | | * - \e a13 = \e a12 + \e a23 | |
| | | | |
| skipping to change at line 143 | | skipping to change at line 143 | |
| * obtained for |<i>f</i>| < 0.2. Here is a table of the approximate | | * obtained for |<i>f</i>| < 0.2. Here is a table of the approximate | |
| * maximum error (expressed as a distance) for an ellipsoid with the same | | * maximum error (expressed as a distance) for an ellipsoid with the same | |
| * major radius as the WGS84 ellipsoid and different values of the | | * major radius as the WGS84 ellipsoid and different values of the | |
| * flattening.<pre> | | * flattening.<pre> | |
| * |f| error | | * |f| error | |
| * 0.01 25 nm | | * 0.01 25 nm | |
| * 0.02 30 nm | | * 0.02 30 nm | |
| * 0.05 10 um | | * 0.05 10 um | |
| * 0.1 1.5 mm | | * 0.1 1.5 mm | |
| * 0.2 300 mm | | * 0.2 300 mm | |
|
| * </pre>For very eccentric ellipsoids, use GeodesicExact instead. | | * </pre> | |
| | | * For very eccentric ellipsoids, use GeodesicExact instead. | |
| * | | * | |
| * The algorithms are described in | | * The algorithms are described in | |
| * - C. F. F. Karney, | | * - C. F. F. Karney, | |
| * <a href="http://dx.doi.org/10.1007/s00190-012-0578-z"> | | * <a href="http://dx.doi.org/10.1007/s00190-012-0578-z"> | |
| * Algorithms for geodesics</a>, | | * Algorithms for geodesics</a>, | |
| * J. Geodesy <b>87</b>, 43--55 (2013); | | * J. Geodesy <b>87</b>, 43--55 (2013); | |
| * DOI: <a href="http://dx.doi.org/10.1007/s00190-012-0578-z"> | | * DOI: <a href="http://dx.doi.org/10.1007/s00190-012-0578-z"> | |
| * 10.1007/s00190-012-0578-z</a>; | | * 10.1007/s00190-012-0578-z</a>; | |
| * addenda: <a href="http://geographiclib.sf.net/geod-addenda.html"> | | * addenda: <a href="http://geographiclib.sf.net/geod-addenda.html"> | |
| * geod-addenda.html</a>. | | * geod-addenda.html</a>. | |
| | | | |
| skipping to change at line 237 | | skipping to change at line 238 | |
| real ssig1, real csig1, real dn1, | | real ssig1, real csig1, real dn1, | |
| real ssig2, real csig2, real dn2, | | real ssig2, real csig2, real dn2, | |
| real cbet1, real cbet2, | | real cbet1, real cbet2, | |
| real& s12s, real& m12a, real& m0, | | real& s12s, real& m12a, real& m0, | |
| bool scalep, real& M12, real& M21, | | bool scalep, real& M12, real& M21, | |
| real C1a[], real C2a[]) const throw(); | | real C1a[], real C2a[]) const throw(); | |
| real InverseStart(real sbet1, real cbet1, real dn1, | | real InverseStart(real sbet1, real cbet1, real dn1, | |
| real sbet2, real cbet2, real dn2, | | real sbet2, real cbet2, real dn2, | |
| real lam12, | | real lam12, | |
| real& salp1, real& calp1, | | real& salp1, real& calp1, | |
|
| real& salp2, real& calp2, | | real& salp2, real& calp2, real& dnm, | |
| real C1a[], real C2a[]) const throw(); | | real C1a[], real C2a[]) const throw(); | |
| real Lambda12(real sbet1, real cbet1, real dn1, | | real Lambda12(real sbet1, real cbet1, real dn1, | |
| real sbet2, real cbet2, real dn2, | | real sbet2, real cbet2, real dn2, | |
| real salp1, real calp1, | | real salp1, real calp1, | |
| real& salp2, real& calp2, real& sig12, | | real& salp2, real& calp2, real& sig12, | |
| real& ssig1, real& csig1, real& ssig2, real& csig2, | | real& ssig1, real& csig1, real& ssig2, real& csig2, | |
| real& eps, real& domg12, bool diffp, real& dlam12, | | real& eps, real& domg12, bool diffp, real& dlam12, | |
| real C1a[], real C2a[], real C3a[]) | | real C1a[], real C2a[], real C3a[]) | |
| const throw(); | | const throw(); | |
| | | | |
| | | | |
| skipping to change at line 324 | | skipping to change at line 325 | |
| * Calculate geodesic scales \e M12 and \e M21. | | * Calculate geodesic scales \e M12 and \e M21. | |
| * @hideinitializer | | * @hideinitializer | |
| ********************************************************************
**/ | | ********************************************************************
**/ | |
| GEODESICSCALE = 1U<<13 | CAP_C1 | CAP_C2, | | GEODESICSCALE = 1U<<13 | CAP_C1 | CAP_C2, | |
| /** | | /** | |
| * Calculate area \e S12. | | * Calculate area \e S12. | |
| * @hideinitializer | | * @hideinitializer | |
| ********************************************************************
**/ | | ********************************************************************
**/ | |
| AREA = 1U<<14 | CAP_C4, | | AREA = 1U<<14 | CAP_C4, | |
| /** | | /** | |
|
| * All capabilities. Calculate everything. | | * All capabilities, calculate everything. | |
| * @hideinitializer | | * @hideinitializer | |
| ********************************************************************
**/ | | ********************************************************************
**/ | |
| ALL = OUT_ALL| CAP_ALL, | | ALL = OUT_ALL| CAP_ALL, | |
| }; | | }; | |
| | | | |
| /** \name Constructor | | /** \name Constructor | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| /** | | /** | |
| * Constructor for a ellipsoid with | | * Constructor for a ellipsoid with | |
| | | | |
| skipping to change at line 351 | | skipping to change at line 352 | |
| * positive. | | * positive. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Geodesic(real a, real f); | | Geodesic(real a, real f); | |
| ///@} | | ///@} | |
| | | | |
| /** \name Direct geodesic problem specified in terms of distance. | | /** \name Direct geodesic problem specified in terms of distance. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| /** | | /** | |
| * Solve the direct geodesic problem where the length of the geodesic | | * Solve the direct geodesic problem where the length of the geodesic | |
|
| * is specify in terms of distance. | | * is specified in terms of distance. | |
| * | | * | |
| * @param[in] lat1 latitude of point 1 (degrees). | | * @param[in] lat1 latitude of point 1 (degrees). | |
| * @param[in] lon1 longitude of point 1 (degrees). | | * @param[in] lon1 longitude of point 1 (degrees). | |
| * @param[in] azi1 azimuth at point 1 (degrees). | | * @param[in] azi1 azimuth at point 1 (degrees). | |
| * @param[in] s12 distance between point 1 and point 2 (meters); it can
be | | * @param[in] s12 distance between point 1 and point 2 (meters); it can
be | |
| * negative. | | * negative. | |
| * @param[out] lat2 latitude of point 2 (degrees). | | * @param[out] lat2 latitude of point 2 (degrees). | |
| * @param[out] lon2 longitude of point 2 (degrees). | | * @param[out] lon2 longitude of point 2 (degrees). | |
| * @param[out] azi2 (forward) azimuth at point 2 (degrees). | | * @param[out] azi2 (forward) azimuth at point 2 (degrees). | |
| * @param[out] m12 reduced length of geodesic (meters). | | * @param[out] m12 reduced length of geodesic (meters). | |
| | | | |
| skipping to change at line 375 | | skipping to change at line 376 | |
| * (dimensionless). | | * (dimensionless). | |
| * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | | * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | |
| * @return \e a12 arc length of between point 1 and point 2 (degrees). | | * @return \e a12 arc length of between point 1 and point 2 (degrees). | |
| * | | * | |
| * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | | * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | |
| * azi1 should be in the range [−540°, 540°). The values
of | | * azi1 should be in the range [−540°, 540°). The values
of | |
| * \e lon2 and \e azi2 returned are in the range [−180°, | | * \e lon2 and \e azi2 returned are in the range [−180°, | |
| * 180°). | | * 180°). | |
| * | | * | |
| * If either point is at a pole, the azimuth is defined by keeping the | | * If either point is at a pole, the azimuth is defined by keeping the | |
|
| * longitude fixed and writing \e lat = ±(90° − &epsil
on;) | | * longitude fixed, writing \e lat = ±(90° − ε
), | |
| * and taking the limit ε → 0+. An arc length greater tha
t | | * and taking the limit ε → 0+. An arc length greater tha
t | |
| * 180° signifies a geodesic which is not a shortest path. (For a | | * 180° signifies a geodesic which is not a shortest path. (For a | |
| * prolate ellipsoid, an additional condition is necessary for a shorte
st | | * prolate ellipsoid, an additional condition is necessary for a shorte
st | |
| * path: the longitudinal extent must not exceed of 180°.) | | * path: the longitudinal extent must not exceed of 180°.) | |
| * | | * | |
| * The following functions are overloaded versions of Geodesic::Direct | | * The following functions are overloaded versions of Geodesic::Direct | |
| * which omit some of the output parameters. Note, however, that the a
rc | | * which omit some of the output parameters. Note, however, that the a
rc | |
| * length is always computed and returned as the function value. | | * length is always computed and returned as the function value. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Direct(real lat1, real lon1, real azi1, real s12, | | Math::real Direct(real lat1, real lon1, real azi1, real s12, | |
| | | | |
| skipping to change at line 465 | | skipping to change at line 466 | |
| REDUCEDLENGTH | GEODESICSCALE, | | REDUCEDLENGTH | GEODESICSCALE, | |
| lat2, lon2, azi2, t, m12, M12, M21, t); | | lat2, lon2, azi2, t, m12, M12, M21, t); | |
| } | | } | |
| ///@} | | ///@} | |
| | | | |
| /** \name Direct geodesic problem specified in terms of arc length. | | /** \name Direct geodesic problem specified in terms of arc length. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| /** | | /** | |
| * Solve the direct geodesic problem where the length of the geodesic | | * Solve the direct geodesic problem where the length of the geodesic | |
|
| * is specify in terms of arc length. | | * is specified in terms of arc length. | |
| * | | * | |
| * @param[in] lat1 latitude of point 1 (degrees). | | * @param[in] lat1 latitude of point 1 (degrees). | |
| * @param[in] lon1 longitude of point 1 (degrees). | | * @param[in] lon1 longitude of point 1 (degrees). | |
| * @param[in] azi1 azimuth at point 1 (degrees). | | * @param[in] azi1 azimuth at point 1 (degrees). | |
| * @param[in] a12 arc length between point 1 and point 2 (degrees); it
can | | * @param[in] a12 arc length between point 1 and point 2 (degrees); it
can | |
| * be negative. | | * be negative. | |
| * @param[out] lat2 latitude of point 2 (degrees). | | * @param[out] lat2 latitude of point 2 (degrees). | |
| * @param[out] lon2 longitude of point 2 (degrees). | | * @param[out] lon2 longitude of point 2 (degrees). | |
| * @param[out] azi2 (forward) azimuth at point 2 (degrees). | | * @param[out] azi2 (forward) azimuth at point 2 (degrees). | |
| * @param[out] s12 distance between point 1 and point 2 (meters). | | * @param[out] s12 distance between point 1 and point 2 (meters). | |
| | | | |
| skipping to change at line 489 | | skipping to change at line 490 | |
| * @param[out] M21 geodesic scale of point 1 relative to point 2 | | * @param[out] M21 geodesic scale of point 1 relative to point 2 | |
| * (dimensionless). | | * (dimensionless). | |
| * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | | * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | |
| * | | * | |
| * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | | * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | |
| * azi1 should be in the range [−540°, 540°). The values
of | | * azi1 should be in the range [−540°, 540°). The values
of | |
| * \e lon2 and \e azi2 returned are in the range [−180°, | | * \e lon2 and \e azi2 returned are in the range [−180°, | |
| * 180°). | | * 180°). | |
| * | | * | |
| * If either point is at a pole, the azimuth is defined by keeping the | | * If either point is at a pole, the azimuth is defined by keeping the | |
|
| * longitude fixed and writing \e lat = ±(90° − &epsil
on;) | | * longitude fixed, writing \e lat = ±(90° − ε
), | |
| * and taking the limit ε → 0+. An arc length greater tha
t | | * and taking the limit ε → 0+. An arc length greater tha
t | |
| * 180° signifies a geodesic which is not a shortest path. (For a | | * 180° signifies a geodesic which is not a shortest path. (For a | |
| * prolate ellipsoid, an additional condition is necessary for a shorte
st | | * prolate ellipsoid, an additional condition is necessary for a shorte
st | |
| * path: the longitudinal extent must not exceed of 180°.) | | * path: the longitudinal extent must not exceed of 180°.) | |
| * | | * | |
| * The following functions are overloaded versions of Geodesic::Direct | | * The following functions are overloaded versions of Geodesic::Direct | |
| * which omit some of the output parameters. | | * which omit some of the output parameters. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| void ArcDirect(real lat1, real lon1, real azi1, real a12, | | void ArcDirect(real lat1, real lon1, real azi1, real a12, | |
| real& lat2, real& lon2, real& azi2, real& s12, | | real& lat2, real& lon2, real& azi2, real& s12, | |
| | | | |
| skipping to change at line 613 | | skipping to change at line 614 | |
| * @param[out] s12 distance between point 1 and point 2 (meters). | | * @param[out] s12 distance between point 1 and point 2 (meters). | |
| * @param[out] m12 reduced length of geodesic (meters). | | * @param[out] m12 reduced length of geodesic (meters). | |
| * @param[out] M12 geodesic scale of point 2 relative to point 1 | | * @param[out] M12 geodesic scale of point 2 relative to point 1 | |
| * (dimensionless). | | * (dimensionless). | |
| * @param[out] M21 geodesic scale of point 1 relative to point 2 | | * @param[out] M21 geodesic scale of point 1 relative to point 2 | |
| * (dimensionless). | | * (dimensionless). | |
| * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | | * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | |
| * @return \e a12 arc length of between point 1 and point 2 (degrees). | | * @return \e a12 arc length of between point 1 and point 2 (degrees). | |
| * | | * | |
| * The Geodesic::mask values possible for \e outmask are | | * The Geodesic::mask values possible for \e outmask are | |
|
| * - \e outmask |= Geodesic::LATITUDE for the latitude \e lat2. | | * - \e outmask |= Geodesic::LATITUDE for the latitude \e lat2; | |
| * - \e outmask |= Geodesic::LONGITUDE for the latitude \e lon2. | | * - \e outmask |= Geodesic::LONGITUDE for the latitude \e lon2; | |
| * - \e outmask |= Geodesic::AZIMUTH for the latitude \e azi2. | | * - \e outmask |= Geodesic::AZIMUTH for the latitude \e azi2; | |
| * - \e outmask |= Geodesic::DISTANCE for the distance \e s12. | | * - \e outmask |= Geodesic::DISTANCE for the distance \e s12; | |
| * - \e outmask |= Geodesic::REDUCEDLENGTH for the reduced length \e | | * - \e outmask |= Geodesic::REDUCEDLENGTH for the reduced length \e | |
|
| * m12. | | * m12; | |
| * - \e outmask |= Geodesic::GEODESICSCALE for the geodesic scales \e | | * - \e outmask |= Geodesic::GEODESICSCALE for the geodesic scales \e | |
|
| * M12 and \e M21. | | * M12 and \e M21; | |
| * - \e outmask |= Geodesic::AREA for the area \e S12. | | * - \e outmask |= Geodesic::AREA for the area \e S12; | |
| | | * - \e outmask |= Geodesic::ALL for all of the above. | |
| * . | | * . | |
| * The function value \e a12 is always computed and returned and this | | * The function value \e a12 is always computed and returned and this | |
| * equals \e s12_a12 is \e arcmode is true. If \e outmask includes | | * equals \e s12_a12 is \e arcmode is true. If \e outmask includes | |
| * Geodesic::DISTANCE and \e arcmode is false, then \e s12 = \e s12_a12
. | | * Geodesic::DISTANCE and \e arcmode is false, then \e s12 = \e s12_a12
. | |
| * It is not necessary to include Geodesic::DISTANCE_IN in \e outmask;
this | | * It is not necessary to include Geodesic::DISTANCE_IN in \e outmask;
this | |
| * is automatically included is \e arcmode is false. | | * is automatically included is \e arcmode is false. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real GenDirect(real lat1, real lon1, real azi1, | | Math::real GenDirect(real lat1, real lon1, real azi1, | |
| bool arcmode, real s12_a12, unsigned outmask, | | bool arcmode, real s12_a12, unsigned outmask, | |
| real& lat2, real& lon2, real& azi2, | | real& lat2, real& lon2, real& azi2, | |
| | | | |
| skipping to change at line 663 | | skipping to change at line 665 | |
| * (dimensionless). | | * (dimensionless). | |
| * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | | * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | |
| * @return \e a12 arc length of between point 1 and point 2 (degrees). | | * @return \e a12 arc length of between point 1 and point 2 (degrees). | |
| * | | * | |
| * \e lat1 and \e lat2 should be in the range [−90°, 90°]
; \e | | * \e lat1 and \e lat2 should be in the range [−90°, 90°]
; \e | |
| * lon1 and \e lon2 should be in the range [−540°, 540°). | | * lon1 and \e lon2 should be in the range [−540°, 540°). | |
| * The values of \e azi1 and \e azi2 returned are in the range | | * The values of \e azi1 and \e azi2 returned are in the range | |
| * [−180°, 180°). | | * [−180°, 180°). | |
| * | | * | |
| * If either point is at a pole, the azimuth is defined by keeping the | | * If either point is at a pole, the azimuth is defined by keeping the | |
|
| * longitude fixed and writing \e lat = ±(90° − &epsil
on;) | | * longitude fixed, writing \e lat = ±(90° − ε
), | |
| * and taking the limit ε → 0+. | | * and taking the limit ε → 0+. | |
| * | | * | |
| * The solution to the inverse problem is found using Newton's method.
If | | * The solution to the inverse problem is found using Newton's method.
If | |
| * this fails to converge (this is very unlikely in geodetic applicatio
ns | | * this fails to converge (this is very unlikely in geodetic applicatio
ns | |
| * but does occur for very eccentric ellipsoids), then the bisection me
thod | | * but does occur for very eccentric ellipsoids), then the bisection me
thod | |
| * is used to refine the solution. | | * is used to refine the solution. | |
| * | | * | |
| * The following functions are overloaded versions of Geodesic::Inverse | | * The following functions are overloaded versions of Geodesic::Inverse | |
| * which omit some of the output parameters. Note, however, that the a
rc | | * which omit some of the output parameters. Note, however, that the a
rc | |
| * length is always computed and returned as the function value. | | * length is always computed and returned as the function value. | |
| | | | |
| skipping to change at line 781 | | skipping to change at line 783 | |
| * @param[out] azi2 (forward) azimuth at point 2 (degrees). | | * @param[out] azi2 (forward) azimuth at point 2 (degrees). | |
| * @param[out] m12 reduced length of geodesic (meters). | | * @param[out] m12 reduced length of geodesic (meters). | |
| * @param[out] M12 geodesic scale of point 2 relative to point 1 | | * @param[out] M12 geodesic scale of point 2 relative to point 1 | |
| * (dimensionless). | | * (dimensionless). | |
| * @param[out] M21 geodesic scale of point 1 relative to point 2 | | * @param[out] M21 geodesic scale of point 1 relative to point 2 | |
| * (dimensionless). | | * (dimensionless). | |
| * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | | * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | |
| * @return \e a12 arc length of between point 1 and point 2 (degrees). | | * @return \e a12 arc length of between point 1 and point 2 (degrees). | |
| * | | * | |
| * The Geodesic::mask values possible for \e outmask are | | * The Geodesic::mask values possible for \e outmask are | |
|
| * - \e outmask |= Geodesic::DISTANCE for the distance \e s12. | | * - \e outmask |= Geodesic::DISTANCE for the distance \e s12; | |
| * - \e outmask |= Geodesic::AZIMUTH for the latitude \e azi2. | | * - \e outmask |= Geodesic::AZIMUTH for the latitude \e azi2; | |
| * - \e outmask |= Geodesic::REDUCEDLENGTH for the reduced length \e | | * - \e outmask |= Geodesic::REDUCEDLENGTH for the reduced length \e | |
|
| * m12. | | * m12; | |
| * - \e outmask |= Geodesic::GEODESICSCALE for the geodesic scales \e | | * - \e outmask |= Geodesic::GEODESICSCALE for the geodesic scales \e | |
|
| * M12 and \e M21. | | * M12 and \e M21; | |
| * - \e outmask |= Geodesic::AREA for the area \e S12. | | * - \e outmask |= Geodesic::AREA for the area \e S12; | |
| | | * - \e outmask |= Geodesic::ALL for all of the above. | |
| * . | | * . | |
| * The arc length is always computed and returned as the function value
. | | * The arc length is always computed and returned as the function value
. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real GenInverse(real lat1, real lon1, real lat2, real lon2, | | Math::real GenInverse(real lat1, real lon1, real lat2, real lon2, | |
| unsigned outmask, | | unsigned outmask, | |
| real& s12, real& azi1, real& azi2, | | real& s12, real& azi1, real& azi2, | |
| real& m12, real& M12, real& M21, real& S12) | | real& m12, real& M12, real& M21, real& S12) | |
| const throw(); | | const throw(); | |
| ///@} | | ///@} | |
| | | | |
| /** \name Interface to GeodesicLine. | | /** \name Interface to GeodesicLine. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| | | | |
| /** | | /** | |
|
| * Set up to compute several points on a singe geodesic. | | * Set up to compute several points on a single geodesic. | |
| * | | * | |
| * @param[in] lat1 latitude of point 1 (degrees). | | * @param[in] lat1 latitude of point 1 (degrees). | |
| * @param[in] lon1 longitude of point 1 (degrees). | | * @param[in] lon1 longitude of point 1 (degrees). | |
| * @param[in] azi1 azimuth at point 1 (degrees). | | * @param[in] azi1 azimuth at point 1 (degrees). | |
| * @param[in] caps bitor'ed combination of Geodesic::mask values | | * @param[in] caps bitor'ed combination of Geodesic::mask values | |
| * specifying the capabilities the GeodesicLine object should possess
, | | * specifying the capabilities the GeodesicLine object should possess
, | |
| * i.e., which quantities can be returned in calls to | | * i.e., which quantities can be returned in calls to | |
|
| * GeodesicLib::Position. | | * GeodesicLine::Position. | |
| | | * @return a GeodesicLine object. | |
| * | | * | |
| * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | | * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | |
| * azi1 should be in the range [−540°, 540°). | | * azi1 should be in the range [−540°, 540°). | |
| * | | * | |
| * The Geodesic::mask values are | | * The Geodesic::mask values are | |
| * - \e caps |= Geodesic::LATITUDE for the latitude \e lat2; this is | | * - \e caps |= Geodesic::LATITUDE for the latitude \e lat2; this is | |
|
| * added automatically | | * added automatically; | |
| * - \e caps |= Geodesic::LONGITUDE for the latitude \e lon2 | | * - \e caps |= Geodesic::LONGITUDE for the latitude \e lon2; | |
| * - \e caps |= Geodesic::AZIMUTH for the azimuth \e azi2; this is | | * - \e caps |= Geodesic::AZIMUTH for the azimuth \e azi2; this is | |
|
| * added automatically | | * added automatically; | |
| * - \e caps |= Geodesic::DISTANCE for the distance \e s12 | | * - \e caps |= Geodesic::DISTANCE for the distance \e s12; | |
| * - \e caps |= Geodesic::REDUCEDLENGTH for the reduced length \e m12 | | * - \e caps |= Geodesic::REDUCEDLENGTH for the reduced length \e m12; | |
| * - \e caps |= Geodesic::GEODESICSCALE for the geodesic scales \e M12 | | * - \e caps |= Geodesic::GEODESICSCALE for the geodesic scales \e M12 | |
|
| * and \e M21 | | * and \e M21; | |
| * - \e caps |= Geodesic::AREA for the area \e S12 | | * - \e caps |= Geodesic::AREA for the area \e S12; | |
| * - \e caps |= Geodesic::DISTANCE_IN permits the length of the | | * - \e caps |= Geodesic::DISTANCE_IN permits the length of the | |
| * geodesic to be given in terms of \e s12; without this capability t
he | | * geodesic to be given in terms of \e s12; without this capability t
he | |
|
| * length can only be specified in terms of arc length. | | * length can only be specified in terms of arc length; | |
| | | * - \e caps |= Geodesic::ALL for all of the above. | |
| * . | | * . | |
|
| * The default value of \e caps is Geodesic::ALL which turns on all the | | * The default value of \e caps is Geodesic::ALL. | |
| * capabilities. | | | |
| * | | * | |
|
| * If the point is at a pole, the azimuth is defined by keeping the \e | | * If the point is at a pole, the azimuth is defined by keeping \e lon1 | |
| lon1 | | * fixed, writing \e lat1 = ±(90 − ε), and taking | |
| * fixed and writing \e lat1 = ±&(90 − ε) and taki | | the | |
| ng | | * limit ε → 0+. | |
| * the limit ε → 0+. | | | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| GeodesicLine Line(real lat1, real lon1, real azi1, unsigned caps = ALL) | | GeodesicLine Line(real lat1, real lon1, real azi1, unsigned caps = ALL) | |
| const throw(); | | const throw(); | |
| | | | |
| ///@} | | ///@} | |
| | | | |
| /** \name Inspector functions. | | /** \name Inspector functions. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| | | | |
| | | | |
End of changes. 25 change blocks. |
| 55 lines changed or deleted | | 59 lines changed or added | |
|
| GeodesicExact.hpp | | GeodesicExact.hpp | |
| /** | | /** | |
| * \file GeodesicExact.hpp | | * \file GeodesicExact.hpp | |
| * \brief Header for GeographicLib::GeodesicExact class | | * \brief Header for GeographicLib::GeodesicExact class | |
| * | | * | |
|
| * Copyright (c) Charles Karney (2012) <charles@karney.com> and licensed un | | * Copyright (c) Charles Karney (2012-2013) <charles@karney.com> and licens | |
| der | | ed | |
| * the MIT/X11 License. For more information, see | | * under the MIT/X11 License. For more information, see | |
| * http://geographiclib.sourceforge.net/ | | * http://geographiclib.sourceforge.net/ | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if !defined(GEOGRAPHICLIB_GEODESICEXACT_HPP) | | #if !defined(GEOGRAPHICLIB_GEODESICEXACT_HPP) | |
| #define GEOGRAPHICLIB_GEODESICEXACT_HPP 1 | | #define GEOGRAPHICLIB_GEODESICEXACT_HPP 1 | |
| | | | |
| #include <GeographicLib/Constants.hpp> | | #include <GeographicLib/Constants.hpp> | |
| #include <GeographicLib/EllipticFunction.hpp> | | #include <GeographicLib/EllipticFunction.hpp> | |
| | | | |
| #if !defined(GEOGRAPHICLIB_GEODESICEXACT_ORDER) | | #if !defined(GEOGRAPHICLIB_GEODESICEXACT_ORDER) | |
| | | | |
| skipping to change at line 144 | | skipping to change at line 144 | |
| real ssig1, real csig1, real dn1, | | real ssig1, real csig1, real dn1, | |
| real ssig2, real csig2, real dn2, | | real ssig2, real csig2, real dn2, | |
| real cbet1, real cbet2, | | real cbet1, real cbet2, | |
| real& s12s, real& m12a, real& m0, | | real& s12s, real& m12a, real& m0, | |
| bool scalep, real& M12, real& M21) const throw(); | | bool scalep, real& M12, real& M21) const throw(); | |
| real InverseStart(EllipticFunction& E, | | real InverseStart(EllipticFunction& E, | |
| real sbet1, real cbet1, real dn1, | | real sbet1, real cbet1, real dn1, | |
| real sbet2, real cbet2, real dn2, | | real sbet2, real cbet2, real dn2, | |
| real lam12, | | real lam12, | |
| real& salp1, real& calp1, | | real& salp1, real& calp1, | |
|
| real& salp2, real& calp2) const throw(); | | real& salp2, real& calp2, real& dnm) const throw(); | |
| real Lambda12(real sbet1, real cbet1, real dn1, | | real Lambda12(real sbet1, real cbet1, real dn1, | |
| real sbet2, real cbet2, real dn2, | | real sbet2, real cbet2, real dn2, | |
| real salp1, real calp1, | | real salp1, real calp1, | |
| real& salp2, real& calp2, real& sig12, | | real& salp2, real& calp2, real& sig12, | |
| real& ssig1, real& csig1, real& ssig2, real& csig2, | | real& ssig1, real& csig1, real& ssig2, real& csig2, | |
| EllipticFunction& E, | | EllipticFunction& E, | |
| real& omg12, bool diffp, real& dlam12) | | real& omg12, bool diffp, real& dlam12) | |
| const throw(); | | const throw(); | |
| | | | |
| // These are Maxima generated functions to provide series approximation
s to | | // These are Maxima generated functions to provide series approximation
s to | |
| | | | |
| skipping to change at line 221 | | skipping to change at line 221 | |
| * Calculate geodesic scales \e M12 and \e M21. | | * Calculate geodesic scales \e M12 and \e M21. | |
| * @hideinitializer | | * @hideinitializer | |
| ********************************************************************
**/ | | ********************************************************************
**/ | |
| GEODESICSCALE = 1U<<13 | CAP_D, | | GEODESICSCALE = 1U<<13 | CAP_D, | |
| /** | | /** | |
| * Calculate area \e S12. | | * Calculate area \e S12. | |
| * @hideinitializer | | * @hideinitializer | |
| ********************************************************************
**/ | | ********************************************************************
**/ | |
| AREA = 1U<<14 | CAP_C4, | | AREA = 1U<<14 | CAP_C4, | |
| /** | | /** | |
|
| * All capabilities. Calculate everything. | | * All capabilities, calculate everything. | |
| * @hideinitializer | | * @hideinitializer | |
| ********************************************************************
**/ | | ********************************************************************
**/ | |
| ALL = OUT_ALL| CAP_ALL, | | ALL = OUT_ALL| CAP_ALL, | |
| }; | | }; | |
| | | | |
| /** \name Constructor | | /** \name Constructor | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| /** | | /** | |
| * Constructor for a ellipsoid with | | * Constructor for a ellipsoid with | |
| | | | |
| skipping to change at line 248 | | skipping to change at line 248 | |
| * positive. | | * positive. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| GeodesicExact(real a, real f); | | GeodesicExact(real a, real f); | |
| ///@} | | ///@} | |
| | | | |
| /** \name Direct geodesic problem specified in terms of distance. | | /** \name Direct geodesic problem specified in terms of distance. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| /** | | /** | |
| * Perform the direct geodesic calculation where the length of the geod
esic | | * Perform the direct geodesic calculation where the length of the geod
esic | |
|
| * is specify in terms of distance. | | * is specified in terms of distance. | |
| * | | * | |
| * @param[in] lat1 latitude of point 1 (degrees). | | * @param[in] lat1 latitude of point 1 (degrees). | |
| * @param[in] lon1 longitude of point 1 (degrees). | | * @param[in] lon1 longitude of point 1 (degrees). | |
| * @param[in] azi1 azimuth at point 1 (degrees). | | * @param[in] azi1 azimuth at point 1 (degrees). | |
| * @param[in] s12 distance between point 1 and point 2 (meters); it can
be | | * @param[in] s12 distance between point 1 and point 2 (meters); it can
be | |
| * signed. | | * signed. | |
| * @param[out] lat2 latitude of point 2 (degrees). | | * @param[out] lat2 latitude of point 2 (degrees). | |
| * @param[out] lon2 longitude of point 2 (degrees). | | * @param[out] lon2 longitude of point 2 (degrees). | |
| * @param[out] azi2 (forward) azimuth at point 2 (degrees). | | * @param[out] azi2 (forward) azimuth at point 2 (degrees). | |
| * @param[out] m12 reduced length of geodesic (meters). | | * @param[out] m12 reduced length of geodesic (meters). | |
| | | | |
| skipping to change at line 272 | | skipping to change at line 272 | |
| * (dimensionless). | | * (dimensionless). | |
| * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | | * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | |
| * @return \e a12 arc length of between point 1 and point 2 (degrees). | | * @return \e a12 arc length of between point 1 and point 2 (degrees). | |
| * | | * | |
| * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | | * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | |
| * azi1 should be in the range [−540°, 540°). The values
of | | * azi1 should be in the range [−540°, 540°). The values
of | |
| * \e lon2 and \e azi2 returned are in the range [−180°, | | * \e lon2 and \e azi2 returned are in the range [−180°, | |
| * 180°). | | * 180°). | |
| * | | * | |
| * If either point is at a pole, the azimuth is defined by keeping the | | * If either point is at a pole, the azimuth is defined by keeping the | |
|
| * longitude fixed and writing \e lat = ±(90° − &epsil | | * longitude fixed, writing \e lat = ±(90° − ε | |
| on;) | | ), | |
| * and taking the limit ε → 0+.. An arc length greater th | | * and taking the limit ε → 0+. An arc length greater tha | |
| at | | t | |
| * 180° signifies a geodesic which is not a shortest path. (For a | | * 180° signifies a geodesic which is not a shortest path. (For a | |
| * prolate ellipsoid, an additional condition is necessary for a shorte
st | | * prolate ellipsoid, an additional condition is necessary for a shorte
st | |
| * path: the longitudinal extent must not exceed of 180°.) | | * path: the longitudinal extent must not exceed of 180°.) | |
| * | | * | |
| * The following functions are overloaded versions of GeodesicExact::Di
rect | | * The following functions are overloaded versions of GeodesicExact::Di
rect | |
| * which omit some of the output parameters. Note, however, that the a
rc | | * which omit some of the output parameters. Note, however, that the a
rc | |
| * length is always computed and returned as the function value. | | * length is always computed and returned as the function value. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Direct(real lat1, real lon1, real azi1, real s12, | | Math::real Direct(real lat1, real lon1, real azi1, real s12, | |
| real& lat2, real& lon2, real& azi2, | | real& lat2, real& lon2, real& azi2, | |
| | | | |
| skipping to change at line 362 | | skipping to change at line 362 | |
| REDUCEDLENGTH | GEODESICSCALE, | | REDUCEDLENGTH | GEODESICSCALE, | |
| lat2, lon2, azi2, t, m12, M12, M21, t); | | lat2, lon2, azi2, t, m12, M12, M21, t); | |
| } | | } | |
| ///@} | | ///@} | |
| | | | |
| /** \name Direct geodesic problem specified in terms of arc length. | | /** \name Direct geodesic problem specified in terms of arc length. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| /** | | /** | |
| * Perform the direct geodesic calculation where the length of the geod
esic | | * Perform the direct geodesic calculation where the length of the geod
esic | |
|
| * is specify in terms of arc length. | | * is specified in terms of arc length. | |
| * | | * | |
| * @param[in] lat1 latitude of point 1 (degrees). | | * @param[in] lat1 latitude of point 1 (degrees). | |
| * @param[in] lon1 longitude of point 1 (degrees). | | * @param[in] lon1 longitude of point 1 (degrees). | |
| * @param[in] azi1 azimuth at point 1 (degrees). | | * @param[in] azi1 azimuth at point 1 (degrees). | |
| * @param[in] a12 arc length between point 1 and point 2 (degrees); it
can | | * @param[in] a12 arc length between point 1 and point 2 (degrees); it
can | |
| * be signed. | | * be signed. | |
| * @param[out] lat2 latitude of point 2 (degrees). | | * @param[out] lat2 latitude of point 2 (degrees). | |
| * @param[out] lon2 longitude of point 2 (degrees). | | * @param[out] lon2 longitude of point 2 (degrees). | |
| * @param[out] azi2 (forward) azimuth at point 2 (degrees). | | * @param[out] azi2 (forward) azimuth at point 2 (degrees). | |
| * @param[out] s12 distance between point 1 and point 2 (meters). | | * @param[out] s12 distance between point 1 and point 2 (meters). | |
| | | | |
| skipping to change at line 386 | | skipping to change at line 386 | |
| * @param[out] M21 geodesic scale of point 1 relative to point 2 | | * @param[out] M21 geodesic scale of point 1 relative to point 2 | |
| * (dimensionless). | | * (dimensionless). | |
| * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | | * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | |
| * | | * | |
| * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | | * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | |
| * azi1 should be in the range [−540°, 540°). The values
of | | * azi1 should be in the range [−540°, 540°). The values
of | |
| * \e lon2 and \e azi2 returned are in the range [−180°, | | * \e lon2 and \e azi2 returned are in the range [−180°, | |
| * 180°). | | * 180°). | |
| * | | * | |
| * If either point is at a pole, the azimuth is defined by keeping the | | * If either point is at a pole, the azimuth is defined by keeping the | |
|
| * longitude fixed and writing \e lat = ±(90° − &epsil
on;) | | * longitude fixed, writing \e lat = ±(90° − ε
), | |
| * and taking the limit ε → 0+. An arc length greater tha
t | | * and taking the limit ε → 0+. An arc length greater tha
t | |
| * 180° signifies a geodesic which is not a shortest path. (For a | | * 180° signifies a geodesic which is not a shortest path. (For a | |
| * prolate ellipsoid, an additional condition is necessary for a shorte
st | | * prolate ellipsoid, an additional condition is necessary for a shorte
st | |
| * path: the longitudinal extent must not exceed of 180°.) | | * path: the longitudinal extent must not exceed of 180°.) | |
| * | | * | |
| * The following functions are overloaded versions of GeodesicExact::Di
rect | | * The following functions are overloaded versions of GeodesicExact::Di
rect | |
| * which omit some of the output parameters. | | * which omit some of the output parameters. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| void ArcDirect(real lat1, real lon1, real azi1, real a12, | | void ArcDirect(real lat1, real lon1, real azi1, real a12, | |
| real& lat2, real& lon2, real& azi2, real& s12, | | real& lat2, real& lon2, real& azi2, real& s12, | |
| | | | |
| skipping to change at line 510 | | skipping to change at line 510 | |
| * @param[out] s12 distance between point 1 and point 2 (meters). | | * @param[out] s12 distance between point 1 and point 2 (meters). | |
| * @param[out] m12 reduced length of geodesic (meters). | | * @param[out] m12 reduced length of geodesic (meters). | |
| * @param[out] M12 geodesic scale of point 2 relative to point 1 | | * @param[out] M12 geodesic scale of point 2 relative to point 1 | |
| * (dimensionless). | | * (dimensionless). | |
| * @param[out] M21 geodesic scale of point 1 relative to point 2 | | * @param[out] M21 geodesic scale of point 1 relative to point 2 | |
| * (dimensionless). | | * (dimensionless). | |
| * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | | * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | |
| * @return \e a12 arc length of between point 1 and point 2 (degrees). | | * @return \e a12 arc length of between point 1 and point 2 (degrees). | |
| * | | * | |
| * The GeodesicExact::mask values possible for \e outmask are | | * The GeodesicExact::mask values possible for \e outmask are | |
|
| * - \e outmask |= GeodesicExact::LATITUDE for the latitude \e lat2. | | * - \e outmask |= GeodesicExact::LATITUDE for the latitude \e lat2; | |
| * - \e outmask |= GeodesicExact::LONGITUDE for the latitude \e lon2. | | * - \e outmask |= GeodesicExact::LONGITUDE for the latitude \e lon2; | |
| * - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2. | | * - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2; | |
| * - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12. | | * - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12; | |
| * - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length
\e | | * - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length
\e | |
|
| * m12. | | * m12; | |
| * - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales
\e | | * - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales
\e | |
|
| * M12 and \e M21. | | * M12 and \e M21; | |
| * - \e outmask |= GeodesicExact::AREA for the area \e S12. | | * - \e outmask |= GeodesicExact::AREA for the area \e S12; | |
| | | * - \e outmask |= GeodesicExact::ALL for all of the above. | |
| * . | | * . | |
| * The function value \e a12 is always computed and returned and this | | * The function value \e a12 is always computed and returned and this | |
| * equals \e s12_a12 is \e arcmode is true. If \e outmask includes | | * equals \e s12_a12 is \e arcmode is true. If \e outmask includes | |
| * GeodesicExact::DISTANCE and \e arcmode is false, then \e s12 = \e | | * GeodesicExact::DISTANCE and \e arcmode is false, then \e s12 = \e | |
| * s12_a12. It is not necessary to include GeodesicExact::DISTANCE_IN
in | | * s12_a12. It is not necessary to include GeodesicExact::DISTANCE_IN
in | |
| * \e outmask; this is automatically included is \e arcmode is false. | | * \e outmask; this is automatically included is \e arcmode is false. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real GenDirect(real lat1, real lon1, real azi1, | | Math::real GenDirect(real lat1, real lon1, real azi1, | |
| bool arcmode, real s12_a12, unsigned outmask, | | bool arcmode, real s12_a12, unsigned outmask, | |
| real& lat2, real& lon2, real& azi2, | | real& lat2, real& lon2, real& azi2, | |
| | | | |
| skipping to change at line 560 | | skipping to change at line 561 | |
| * (dimensionless). | | * (dimensionless). | |
| * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | | * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | |
| * @return \e a12 arc length of between point 1 and point 2 (degrees). | | * @return \e a12 arc length of between point 1 and point 2 (degrees). | |
| * | | * | |
| * \e lat1 and \e lat2 should be in the range [−90°, 90°]
; \e | | * \e lat1 and \e lat2 should be in the range [−90°, 90°]
; \e | |
| * lon1 and \e lon2 should be in the range [−540°, 540°). | | * lon1 and \e lon2 should be in the range [−540°, 540°). | |
| * The values of \e azi1 and \e azi2 returned are in the range | | * The values of \e azi1 and \e azi2 returned are in the range | |
| * [−180°, 180°). | | * [−180°, 180°). | |
| * | | * | |
| * If either point is at a pole, the azimuth is defined by keeping the | | * If either point is at a pole, the azimuth is defined by keeping the | |
|
| * longitude fixed and writing \e lat = ±(90° − &epsil
on;) | | * longitude fixed, writing \e lat = ±(90° − ε
), | |
| * and taking the limit ε → 0+. | | * and taking the limit ε → 0+. | |
| * | | * | |
| * The following functions are overloaded versions of GeodesicExact::In
verse | | * The following functions are overloaded versions of GeodesicExact::In
verse | |
| * which omit some of the output parameters. Note, however, that the a
rc | | * which omit some of the output parameters. Note, however, that the a
rc | |
| * length is always computed and returned as the function value. | | * length is always computed and returned as the function value. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Inverse(real lat1, real lon1, real lat2, real lon2, | | Math::real Inverse(real lat1, real lon1, real lat2, real lon2, | |
| real& s12, real& azi1, real& azi2, real& m12, | | real& s12, real& azi1, real& azi2, real& m12, | |
| real& M12, real& M21, real& S12) const throw() { | | real& M12, real& M21, real& S12) const throw() { | |
| return GenInverse(lat1, lon1, lat2, lon2, | | return GenInverse(lat1, lon1, lat2, lon2, | |
| | | | |
| skipping to change at line 673 | | skipping to change at line 674 | |
| * @param[out] azi2 (forward) azimuth at point 2 (degrees). | | * @param[out] azi2 (forward) azimuth at point 2 (degrees). | |
| * @param[out] m12 reduced length of geodesic (meters). | | * @param[out] m12 reduced length of geodesic (meters). | |
| * @param[out] M12 geodesic scale of point 2 relative to point 1 | | * @param[out] M12 geodesic scale of point 2 relative to point 1 | |
| * (dimensionless). | | * (dimensionless). | |
| * @param[out] M21 geodesic scale of point 1 relative to point 2 | | * @param[out] M21 geodesic scale of point 1 relative to point 2 | |
| * (dimensionless). | | * (dimensionless). | |
| * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | | * @param[out] S12 area under the geodesic (meters<sup>2</sup>). | |
| * @return \e a12 arc length of between point 1 and point 2 (degrees). | | * @return \e a12 arc length of between point 1 and point 2 (degrees). | |
| * | | * | |
| * The GeodesicExact::mask values possible for \e outmask are | | * The GeodesicExact::mask values possible for \e outmask are | |
|
| * - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12. | | * - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12; | |
| * - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2. | | * - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2; | |
| * - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length
\e | | * - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length
\e | |
|
| * m12. | | * m12; | |
| * - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales
\e | | * - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales
\e | |
|
| * M12 and \e M21. | | * M12 and \e M21; | |
| * - \e outmask |= GeodesicExact::AREA for the area \e S12. | | * - \e outmask |= GeodesicExact::AREA for the area \e S12; | |
| | | * - \e outmask |= GeodesicExact::ALL for all of the above. | |
| * . | | * . | |
| * The arc length is always computed and returned as the function value
. | | * The arc length is always computed and returned as the function value
. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real GenInverse(real lat1, real lon1, real lat2, real lon2, | | Math::real GenInverse(real lat1, real lon1, real lat2, real lon2, | |
| unsigned outmask, | | unsigned outmask, | |
| real& s12, real& azi1, real& azi2, | | real& s12, real& azi1, real& azi2, | |
| real& m12, real& M12, real& M21, real& S12) | | real& m12, real& M12, real& M21, real& S12) | |
| const throw(); | | const throw(); | |
| ///@} | | ///@} | |
| | | | |
| /** \name Interface to GeodesicLineExact. | | /** \name Interface to GeodesicLineExact. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| | | | |
| /** | | /** | |
|
| * Set up to compute several points on a singe geodesic. | | * Set up to compute several points on a single geodesic. | |
| * | | * | |
| * @param[in] lat1 latitude of point 1 (degrees). | | * @param[in] lat1 latitude of point 1 (degrees). | |
| * @param[in] lon1 longitude of point 1 (degrees). | | * @param[in] lon1 longitude of point 1 (degrees). | |
| * @param[in] azi1 azimuth at point 1 (degrees). | | * @param[in] azi1 azimuth at point 1 (degrees). | |
| * @param[in] caps bitor'ed combination of GeodesicExact::mask values | | * @param[in] caps bitor'ed combination of GeodesicExact::mask values | |
| * specifying the capabilities the GeodesicLineExact object should | | * specifying the capabilities the GeodesicLineExact object should | |
| * possess, i.e., which quantities can be returned in calls to | | * possess, i.e., which quantities can be returned in calls to | |
|
| * GeodesicLib::Position. | | * GeodesicLineExact::Position. | |
| | | * @return a GeodesicLineExact object. | |
| * | | * | |
| * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | | * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | |
| * azi1 should be in the range [−540°, 540°). | | * azi1 should be in the range [−540°, 540°). | |
| * | | * | |
| * The GeodesicExact::mask values are | | * The GeodesicExact::mask values are | |
| * - \e caps |= GeodesicExact::LATITUDE for the latitude \e lat2; this
is | | * - \e caps |= GeodesicExact::LATITUDE for the latitude \e lat2; this
is | |
|
| * added automatically | | * added automatically; | |
| * - \e caps |= GeodesicExact::LONGITUDE for the latitude \e lon2 | | * - \e caps |= GeodesicExact::LONGITUDE for the latitude \e lon2; | |
| * - \e caps |= GeodesicExact::AZIMUTH for the azimuth \e azi2; this is | | * - \e caps |= GeodesicExact::AZIMUTH for the azimuth \e azi2; this is | |
|
| * added automatically | | * added automatically; | |
| * - \e caps |= GeodesicExact::DISTANCE for the distance \e s12 | | * - \e caps |= GeodesicExact::DISTANCE for the distance \e s12; | |
| * - \e caps |= GeodesicExact::REDUCEDLENGTH for the reduced length \e | | * - \e caps |= GeodesicExact::REDUCEDLENGTH for the reduced length \e | |
| m12 | | m12; | |
| * - \e caps |= GeodesicExact::GEODESICSCALE for the geodesic scales \e
M12 | | * - \e caps |= GeodesicExact::GEODESICSCALE for the geodesic scales \e
M12 | |
|
| * and \e M21 | | * and \e M21; | |
| * - \e caps |= GeodesicExact::AREA for the area \e S12 | | * - \e caps |= GeodesicExact::AREA for the area \e S12; | |
| * - \e caps |= GeodesicExact::DISTANCE_IN permits the length of the | | * - \e caps |= GeodesicExact::DISTANCE_IN permits the length of the | |
| * geodesic to be given in terms of \e s12; without this capability t
he | | * geodesic to be given in terms of \e s12; without this capability t
he | |
|
| * length can only be specified in terms of arc length. | | * length can only be specified in terms of arc length; | |
| | | * - \e caps |= GeodesicExact::ALL for all of the above. | |
| * . | | * . | |
| * The default value of \e caps is GeodesicExact::ALL which turns on al
l | | * The default value of \e caps is GeodesicExact::ALL which turns on al
l | |
| * the capabilities. | | * the capabilities. | |
| * | | * | |
|
| * If the point is at a pole, the azimuth is defined by keeping the \e | | * If the point is at a pole, the azimuth is defined by keeping \e lon1 | |
| lon1 | | * fixed, writing \e lat1 = ±(90 − ε), and taking | |
| * fixed and writing \e lat1 = 90 − ε or −90 + | | the | |
| * ε and taking the limit ε → 0 from above. | | * limit ε → 0+. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| GeodesicLineExact Line(real lat1, real lon1, real azi1, unsigned caps =
ALL) | | GeodesicLineExact Line(real lat1, real lon1, real azi1, unsigned caps =
ALL) | |
| const throw(); | | const throw(); | |
| | | | |
| ///@} | | ///@} | |
| | | | |
| /** \name Inspector functions. | | /** \name Inspector functions. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| | | | |
| | | | |
End of changes. 21 change blocks. |
| 40 lines changed or deleted | | 44 lines changed or added | |
|
| GeodesicLine.hpp | | GeodesicLine.hpp | |
| | | | |
| skipping to change at line 147 | | skipping to change at line 147 | |
| * Calculate geodesic scales \e M12 and \e M21. | | * Calculate geodesic scales \e M12 and \e M21. | |
| * @hideinitializer | | * @hideinitializer | |
| ********************************************************************
**/ | | ********************************************************************
**/ | |
| GEODESICSCALE = Geodesic::GEODESICSCALE, | | GEODESICSCALE = Geodesic::GEODESICSCALE, | |
| /** | | /** | |
| * Calculate area \e S12. | | * Calculate area \e S12. | |
| * @hideinitializer | | * @hideinitializer | |
| ********************************************************************
**/ | | ********************************************************************
**/ | |
| AREA = Geodesic::AREA, | | AREA = Geodesic::AREA, | |
| /** | | /** | |
|
| * All capabilities. Calculate everything. | | * All capabilities, calculate everything. | |
| * @hideinitializer | | * @hideinitializer | |
| ********************************************************************
**/ | | ********************************************************************
**/ | |
| ALL = Geodesic::ALL, | | ALL = Geodesic::ALL, | |
| }; | | }; | |
| | | | |
| /** \name Constructors | | /** \name Constructors | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 169 | | skipping to change at line 169 | |
| * \e lon1, and azimuth \e azi1 (all in degrees). | | * \e lon1, and azimuth \e azi1 (all in degrees). | |
| * | | * | |
| * @param[in] g A Geodesic object used to compute the necessary informa
tion | | * @param[in] g A Geodesic object used to compute the necessary informa
tion | |
| * about the GeodesicLine. | | * about the GeodesicLine. | |
| * @param[in] lat1 latitude of point 1 (degrees). | | * @param[in] lat1 latitude of point 1 (degrees). | |
| * @param[in] lon1 longitude of point 1 (degrees). | | * @param[in] lon1 longitude of point 1 (degrees). | |
| * @param[in] azi1 azimuth at point 1 (degrees). | | * @param[in] azi1 azimuth at point 1 (degrees). | |
| * @param[in] caps bitor'ed combination of GeodesicLine::mask values | | * @param[in] caps bitor'ed combination of GeodesicLine::mask values | |
| * specifying the capabilities the GeodesicLine object should possess
, | | * specifying the capabilities the GeodesicLine object should possess
, | |
| * i.e., which quantities can be returned in calls to | | * i.e., which quantities can be returned in calls to | |
|
| * GeodesicLib::Position. | | * GeodesicLine::Position. | |
| * | | * | |
| * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | | * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | |
| * azi1 should be in the range [−540°, 540°). | | * azi1 should be in the range [−540°, 540°). | |
| * | | * | |
| * The GeodesicLine::mask values are | | * The GeodesicLine::mask values are | |
| * - \e caps |= GeodesicLine::LATITUDE for the latitude \e lat2; this i
s | | * - \e caps |= GeodesicLine::LATITUDE for the latitude \e lat2; this i
s | |
|
| * added automatically | | * added automatically; | |
| * - \e caps |= GeodesicLine::LONGITUDE for the latitude \e lon2 | | * - \e caps |= GeodesicLine::LONGITUDE for the latitude \e lon2; | |
| * - \e caps |= GeodesicLine::AZIMUTH for the latitude \e azi2; this is | | * - \e caps |= GeodesicLine::AZIMUTH for the latitude \e azi2; this is | |
|
| * added automatically | | * added automatically; | |
| * - \e caps |= GeodesicLine::DISTANCE for the distance \e s12 | | * - \e caps |= GeodesicLine::DISTANCE for the distance \e s12; | |
| * - \e caps |= GeodesicLine::REDUCEDLENGTH for the reduced length \e m | | * - \e caps |= GeodesicLine::REDUCEDLENGTH for the reduced length \e m | |
| 12 | | 12; | |
| * - \e caps |= GeodesicLine::GEODESICSCALE for the geodesic scales \e
M12 | | * - \e caps |= GeodesicLine::GEODESICSCALE for the geodesic scales \e
M12 | |
|
| * and \e M21 | | * and \e M21; | |
| * - \e caps |= GeodesicLine::AREA for the area \e S12 | | * - \e caps |= GeodesicLine::AREA for the area \e S12; | |
| * - \e caps |= GeodesicLine::DISTANCE_IN permits the length of the | | * - \e caps |= GeodesicLine::DISTANCE_IN permits the length of the | |
| * geodesic to be given in terms of \e s12; without this capability t
he | | * geodesic to be given in terms of \e s12; without this capability t
he | |
|
| * length can only be specified in terms of arc length. | | * length can only be specified in terms of arc length; | |
| | | * - \e caps |= GeodesicLine::ALL for all of the above. | |
| * . | | * . | |
|
| * The default value of \e caps is GeodesicLine::ALL which turns on all | | * The default value of \e caps is GeodesicLine::ALL. | |
| the | | | |
| * capabilities. | | | |
| * | | * | |
|
| * If the point is at a pole, the azimuth is defined by keeping the \e | | * If the point is at a pole, the azimuth is defined by keeping \e lon1 | |
| lon1 | | * fixed, writing \e lat1 = ±(90° − ε), and ta | |
| * fixed and writing \e lat1 = ±(90° − ε) and | | king | |
| * taking the limit ε → 0+. | | * the limit ε → 0+. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| GeodesicLine(const Geodesic& g, real lat1, real lon1, real azi1, | | GeodesicLine(const Geodesic& g, real lat1, real lon1, real azi1, | |
| unsigned caps = ALL) | | unsigned caps = ALL) | |
| throw(); | | throw(); | |
| | | | |
| /** | | /** | |
| * A default constructor. If GeodesicLine::Position is called on the | | * A default constructor. If GeodesicLine::Position is called on the | |
| * resulting object, it returns immediately (without doing any | | * resulting object, it returns immediately (without doing any | |
| * calculations). The object can be set with a call to Geodesic::Line. | | * calculations). The object can be set with a call to Geodesic::Line. | |
| * Use Init() to test whether object is still in this uninitialized sta
te. | | * Use Init() to test whether object is still in this uninitialized sta
te. | |
| | | | |
| skipping to change at line 487 | | skipping to change at line 487 | |
| * with \e caps |= GeodesicLine::GEODESICSCALE. | | * with \e caps |= GeodesicLine::GEODESICSCALE. | |
| * @param[out] M21 geodesic scale of point 1 relative to point 2 | | * @param[out] M21 geodesic scale of point 1 relative to point 2 | |
| * (dimensionless); requires that the GeodesicLine object was constru
cted | | * (dimensionless); requires that the GeodesicLine object was constru
cted | |
| * with \e caps |= GeodesicLine::GEODESICSCALE. | | * with \e caps |= GeodesicLine::GEODESICSCALE. | |
| * @param[out] S12 area under the geodesic (meters<sup>2</sup>); requir
es | | * @param[out] S12 area under the geodesic (meters<sup>2</sup>); requir
es | |
| * that the GeodesicLine object was constructed with \e caps |= | | * that the GeodesicLine object was constructed with \e caps |= | |
| * GeodesicLine::AREA. | | * GeodesicLine::AREA. | |
| * @return \e a12 arc length of between point 1 and point 2 (degrees). | | * @return \e a12 arc length of between point 1 and point 2 (degrees). | |
| * | | * | |
| * The GeodesicLine::mask values possible for \e outmask are | | * The GeodesicLine::mask values possible for \e outmask are | |
|
| * - \e outmask |= GeodesicLine::LATITUDE for the latitude \e lat2. | | * - \e outmask |= GeodesicLine::LATITUDE for the latitude \e lat2; | |
| * - \e outmask |= GeodesicLine::LONGITUDE for the latitude \e lon2. | | * - \e outmask |= GeodesicLine::LONGITUDE for the latitude \e lon2; | |
| * - \e outmask |= GeodesicLine::AZIMUTH for the latitude \e azi2. | | * - \e outmask |= GeodesicLine::AZIMUTH for the latitude \e azi2; | |
| * - \e outmask |= GeodesicLine::DISTANCE for the distance \e s12. | | * - \e outmask |= GeodesicLine::DISTANCE for the distance \e s12; | |
| * - \e outmask |= GeodesicLine::REDUCEDLENGTH for the reduced length \
e | | * - \e outmask |= GeodesicLine::REDUCEDLENGTH for the reduced length \
e | |
|
| * m12. | | * m12; | |
| * - \e outmask |= GeodesicLine::GEODESICSCALE for the geodesic scales
\e | | * - \e outmask |= GeodesicLine::GEODESICSCALE for the geodesic scales
\e | |
|
| * M12 and \e M21. | | * M12 and \e M21; | |
| * - \e outmask |= GeodesicLine::AREA for the area \e S12. | | * - \e outmask |= GeodesicLine::AREA for the area \e S12; | |
| | | * - \e outmask |= GeodesicLine::ALL for all of the above. | |
| * . | | * . | |
| * Requesting a value which the GeodesicLine object is not capable of | | * Requesting a value which the GeodesicLine object is not capable of | |
| * computing is not an error; the corresponding argument will not be | | * computing is not an error; the corresponding argument will not be | |
| * altered. Note, however, that the arc length is always computed and | | * altered. Note, however, that the arc length is always computed and | |
| * returned as the function value. | | * returned as the function value. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask, | | Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask, | |
| real& lat2, real& lon2, real& azi2, | | real& lat2, real& lon2, real& azi2, | |
| real& s12, real& m12, real& M12, real& M21, | | real& s12, real& m12, real& M12, real& M21, | |
| real& S12) const throw(); | | real& S12) const throw(); | |
| | | | |
| skipping to change at line 538 | | skipping to change at line 539 | |
| { return Init() ? _lon1 : Math::NaN<real>(); } | | { return Init() ? _lon1 : Math::NaN<real>(); } | |
| | | | |
| /** | | /** | |
| * @return \e azi1 the azimuth (degrees) of the geodesic line at point
1. | | * @return \e azi1 the azimuth (degrees) of the geodesic line at point
1. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Azimuth() const throw() | | Math::real Azimuth() const throw() | |
| { return Init() ? _azi1 : Math::NaN<real>(); } | | { return Init() ? _azi1 : Math::NaN<real>(); } | |
| | | | |
| /** | | /** | |
| * @return \e azi0 the azimuth (degrees) of the geodesic line as it cro
sses | | * @return \e azi0 the azimuth (degrees) of the geodesic line as it cro
sses | |
|
| * the equator in a northward direction. | | * the equator in a northward direction. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real EquatorialAzimuth() const throw() { | | Math::real EquatorialAzimuth() const throw() { | |
| return Init() ? | | return Init() ? | |
| atan2(_salp0, _calp0) / Math::degree<real>() : Math::NaN<real>(); | | atan2(_salp0, _calp0) / Math::degree<real>() : Math::NaN<real>(); | |
| } | | } | |
| | | | |
| /** | | /** | |
| * @return \e a1 the arc length (degrees) between the northward equator
ial | | * @return \e a1 the arc length (degrees) between the northward equator
ial | |
|
| * crossing and point 1. | | * crossing and point 1. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real EquatorialArc() const throw() { | | Math::real EquatorialArc() const throw() { | |
| return Init() ? | | return Init() ? | |
| atan2(_ssig1, _csig1) / Math::degree<real>() : Math::NaN<real>(); | | atan2(_ssig1, _csig1) / Math::degree<real>() : Math::NaN<real>(); | |
| } | | } | |
| | | | |
| /** | | /** | |
| * @return \e a the equatorial radius of the ellipsoid (meters). This
is | | * @return \e a the equatorial radius of the ellipsoid (meters). This
is | |
| * the value inherited from the Geodesic object used in the construct
or. | | * the value inherited from the Geodesic object used in the construct
or. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| | | | |
End of changes. 13 change blocks. |
| 27 lines changed or deleted | | 27 lines changed or added | |
|
| GeodesicLineExact.hpp | | GeodesicLineExact.hpp | |
| | | | |
| skipping to change at line 119 | | skipping to change at line 119 | |
| * Calculate geodesic scales \e M12 and \e M21. | | * Calculate geodesic scales \e M12 and \e M21. | |
| * @hideinitializer | | * @hideinitializer | |
| ********************************************************************
**/ | | ********************************************************************
**/ | |
| GEODESICSCALE = GeodesicExact::GEODESICSCALE, | | GEODESICSCALE = GeodesicExact::GEODESICSCALE, | |
| /** | | /** | |
| * Calculate area \e S12. | | * Calculate area \e S12. | |
| * @hideinitializer | | * @hideinitializer | |
| ********************************************************************
**/ | | ********************************************************************
**/ | |
| AREA = GeodesicExact::AREA, | | AREA = GeodesicExact::AREA, | |
| /** | | /** | |
|
| * All capabilities. Calculate everything. | | * All capabilities, calculate everything. | |
| * @hideinitializer | | * @hideinitializer | |
| ********************************************************************
**/ | | ********************************************************************
**/ | |
| ALL = GeodesicExact::ALL, | | ALL = GeodesicExact::ALL, | |
| }; | | }; | |
| | | | |
| /** \name Constructors | | /** \name Constructors | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 141 | | skipping to change at line 141 | |
| * \e lon1, and azimuth \e azi1 (all in degrees). | | * \e lon1, and azimuth \e azi1 (all in degrees). | |
| * | | * | |
| * @param[in] g A GeodesicExact object used to compute the necessary | | * @param[in] g A GeodesicExact object used to compute the necessary | |
| * information about the GeodesicLineExact. | | * information about the GeodesicLineExact. | |
| * @param[in] lat1 latitude of point 1 (degrees). | | * @param[in] lat1 latitude of point 1 (degrees). | |
| * @param[in] lon1 longitude of point 1 (degrees). | | * @param[in] lon1 longitude of point 1 (degrees). | |
| * @param[in] azi1 azimuth at point 1 (degrees). | | * @param[in] azi1 azimuth at point 1 (degrees). | |
| * @param[in] caps bitor'ed combination of GeodesicLineExact::mask valu
es | | * @param[in] caps bitor'ed combination of GeodesicLineExact::mask valu
es | |
| * specifying the capabilities the GeodesicLineExact object should | | * specifying the capabilities the GeodesicLineExact object should | |
| * possess, i.e., which quantities can be returned in calls to | | * possess, i.e., which quantities can be returned in calls to | |
|
| * GeodesicLib::Position. | | * GeodesicLine::Position. | |
| * | | * | |
| * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | | * \e lat1 should be in the range [−90°, 90°]; \e lon1 an
d \e | |
| * azi1 should be in the range [−540°, 540°). | | * azi1 should be in the range [−540°, 540°). | |
| * | | * | |
| * The GeodesicLineExact::mask values are | | * The GeodesicLineExact::mask values are | |
| * - \e caps |= GeodesicLineExact::LATITUDE for the latitude \e lat2; t
his | | * - \e caps |= GeodesicLineExact::LATITUDE for the latitude \e lat2; t
his | |
|
| * is added automatically | | * is added automatically; | |
| * - \e caps |= GeodesicLineExact::LONGITUDE for the latitude \e lon2 | | * - \e caps |= GeodesicLineExact::LONGITUDE for the latitude \e lon2; | |
| * - \e caps |= GeodesicLineExact::AZIMUTH for the latitude \e azi2; th
is is | | * - \e caps |= GeodesicLineExact::AZIMUTH for the latitude \e azi2; th
is is | |
|
| * added automatically | | * added automatically; | |
| * - \e caps |= GeodesicLineExact::DISTANCE for the distance \e s12 | | * - \e caps |= GeodesicLineExact::DISTANCE for the distance \e s12; | |
| * - \e caps |= GeodesicLineExact::REDUCEDLENGTH for the reduced length
\e | | * - \e caps |= GeodesicLineExact::REDUCEDLENGTH for the reduced length
\e | |
|
| m12 | | m12; | |
| * - \e caps |= GeodesicLineExact::GEODESICSCALE for the geodesic scale
s \e | | * - \e caps |= GeodesicLineExact::GEODESICSCALE for the geodesic scale
s \e | |
|
| * M12 and \e M21 | | * M12 and \e M21; | |
| * - \e caps |= GeodesicLineExact::AREA for the area \e S12 | | * - \e caps |= GeodesicLineExact::AREA for the area \e S12; | |
| * - \e caps |= GeodesicLineExact::DISTANCE_IN permits the length of th
e | | * - \e caps |= GeodesicLineExact::DISTANCE_IN permits the length of th
e | |
| * geodesic to be given in terms of \e s12; without this capability t
he | | * geodesic to be given in terms of \e s12; without this capability t
he | |
|
| * length can only be specified in terms of arc length. | | * length can only be specified in terms of arc length; | |
| | | * - \e caps |= GeodesicLineExact::ALL for all of the above. | |
| * . | | * . | |
|
| * The default value of \e caps is GeodesicLineExact::ALL which turns o | | * The default value of \e caps is GeodesicLineExact::ALL. | |
| n | | | |
| * all the capabilities. | | | |
| * | | * | |
|
| * If the point is at a pole, the azimuth is defined by keeping the \e | | * If the point is at a pole, the azimuth is defined by keeping \e lon1 | |
| lon1 | | * fixed, writing \e lat1 = ±(90° − ε), and ta | |
| * fixed and writing \e lat1 = ±(90° − ε) and | | king | |
| * taking the limit ε → 0+. | | * the limit ε → 0+. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| GeodesicLineExact(const GeodesicExact& g, real lat1, real lon1, real az
i1, | | GeodesicLineExact(const GeodesicExact& g, real lat1, real lon1, real az
i1, | |
|
| unsigned caps = ALL) | | unsigned caps = ALL) | |
| throw(); | | throw(); | |
| | | | |
| /** | | /** | |
| * A default constructor. If GeodesicLineExact::Position is called on
the | | * A default constructor. If GeodesicLineExact::Position is called on
the | |
| * resulting object, it returns immediately (without doing any | | * resulting object, it returns immediately (without doing any | |
| * calculations). The object can be set with a call to | | * calculations). The object can be set with a call to | |
| * GeodesicExact::Line. Use Init() to test whether object is still in
this | | * GeodesicExact::Line. Use Init() to test whether object is still in
this | |
| * uninitialized state. | | * uninitialized state. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| GeodesicLineExact() throw() : _caps(0U) {} | | GeodesicLineExact() throw() : _caps(0U) {} | |
| | | | |
| skipping to change at line 461 | | skipping to change at line 461 | |
| * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. | | * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. | |
| * @param[out] M21 geodesic scale of point 1 relative to point 2 | | * @param[out] M21 geodesic scale of point 1 relative to point 2 | |
| * (dimensionless); requires that the GeodesicLineExact object was | | * (dimensionless); requires that the GeodesicLineExact object was | |
| * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. | | * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. | |
| * @param[out] S12 area under the geodesic (meters<sup>2</sup>); requir
es | | * @param[out] S12 area under the geodesic (meters<sup>2</sup>); requir
es | |
| * that the GeodesicLineExact object was constructed with \e caps |= | | * that the GeodesicLineExact object was constructed with \e caps |= | |
| * GeodesicLineExact::AREA. | | * GeodesicLineExact::AREA. | |
| * @return \e a12 arc length of between point 1 and point 2 (degrees). | | * @return \e a12 arc length of between point 1 and point 2 (degrees). | |
| * | | * | |
| * The GeodesicLineExact::mask values possible for \e outmask are | | * The GeodesicLineExact::mask values possible for \e outmask are | |
|
| * - \e outmask |= GeodesicLineExact::LATITUDE for the latitude \e lat2 | | * - \e outmask |= GeodesicLineExact::LATITUDE for the latitude \e lat2 | |
| . | | ; | |
| * - \e outmask |= GeodesicLineExact::LONGITUDE for the latitude \e lon | | * - \e outmask |= GeodesicLineExact::LONGITUDE for the latitude \e lon | |
| 2. | | 2; | |
| * - \e outmask |= GeodesicLineExact::AZIMUTH for the latitude \e azi2. | | * - \e outmask |= GeodesicLineExact::AZIMUTH for the latitude \e azi2; | |
| * - \e outmask |= GeodesicLineExact::DISTANCE for the distance \e s12. | | * - \e outmask |= GeodesicLineExact::DISTANCE for the distance \e s12; | |
| * - \e outmask |= GeodesicLineExact::REDUCEDLENGTH for the reduced len
gth | | * - \e outmask |= GeodesicLineExact::REDUCEDLENGTH for the reduced len
gth | |
|
| * \e m12. | | * \e m12; | |
| * - \e outmask |= GeodesicLineExact::GEODESICSCALE for the geodesic sc
ales | | * - \e outmask |= GeodesicLineExact::GEODESICSCALE for the geodesic sc
ales | |
|
| * \e M12 and \e M21. | | * \e M12 and \e M21; | |
| * - \e outmask |= GeodesicLineExact::AREA for the area \e S12. | | * - \e outmask |= GeodesicLineExact::AREA for the area \e S12; | |
| | | * - \e outmask |= GeodesicLine::ALL for all of the above. | |
| * . | | * . | |
| * Requesting a value which the GeodesicLineExact object is not capable
of | | * Requesting a value which the GeodesicLineExact object is not capable
of | |
| * computing is not an error; the corresponding argument will not be | | * computing is not an error; the corresponding argument will not be | |
| * altered. Note, however, that the arc length is always computed and | | * altered. Note, however, that the arc length is always computed and | |
| * returned as the function value. | | * returned as the function value. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask, | | Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask, | |
| real& lat2, real& lon2, real& azi2, | | real& lat2, real& lon2, real& azi2, | |
| real& s12, real& m12, real& M12, real& M21, | | real& s12, real& m12, real& M12, real& M21, | |
| real& S12) const throw(); | | real& S12) const throw(); | |
| | | | |
End of changes. 13 change blocks. |
| 27 lines changed or deleted | | 27 lines changed or added | |
|
| PolygonArea.hpp | | PolygonArea.hpp | |
| | | | |
| skipping to change at line 58 | | skipping to change at line 58 | |
| private: | | private: | |
| typedef Math::real real; | | typedef Math::real real; | |
| Geodesic _earth; | | Geodesic _earth; | |
| real _area0; // Full ellipsoid area | | real _area0; // Full ellipsoid area | |
| bool _polyline; // Assume polyline (don't close and skip ar
ea) | | bool _polyline; // Assume polyline (don't close and skip ar
ea) | |
| unsigned _mask; | | unsigned _mask; | |
| unsigned _num; | | unsigned _num; | |
| int _crossings; | | int _crossings; | |
| Accumulator<real> _areasum, _perimetersum; | | Accumulator<real> _areasum, _perimetersum; | |
| real _lat0, _lon0, _lat1, _lon1; | | real _lat0, _lon0, _lat1, _lon1; | |
|
| static inline int transit(real lon1, real lon2) { | | static inline int transit(real lon1, real lon2) throw() { | |
| // Return 1 or -1 if crossing prime meridian in east or west directio
n. | | // Return 1 or -1 if crossing prime meridian in east or west directio
n. | |
| // Otherwise return zero. | | // Otherwise return zero. | |
| // Compute lon12 the same way as Geodesic::Inverse. | | // Compute lon12 the same way as Geodesic::Inverse. | |
| lon1 = Math::AngNormalize(lon1); | | lon1 = Math::AngNormalize(lon1); | |
| lon2 = Math::AngNormalize(lon2); | | lon2 = Math::AngNormalize(lon2); | |
| real lon12 = Math::AngDiff(lon1, lon2); | | real lon12 = Math::AngDiff(lon1, lon2); | |
| int cross = | | int cross = | |
| lon1 < 0 && lon2 >= 0 && lon12 > 0 ? 1 : | | lon1 < 0 && lon2 >= 0 && lon12 > 0 ? 1 : | |
| (lon2 < 0 && lon1 >= 0 && lon12 < 0 ? -1 : 0); | | (lon2 < 0 && lon1 >= 0 && lon12 < 0 ? -1 : 0); | |
| return cross; | | return cross; | |
| | | | |
| skipping to change at line 84 | | skipping to change at line 84 | |
| * | | * | |
| * @param[in] earth the Geodesic object to use for geodesic calculation
s. | | * @param[in] earth the Geodesic object to use for geodesic calculation
s. | |
| * By default this uses the WGS84 ellipsoid. | | * By default this uses the WGS84 ellipsoid. | |
| * @param[in] polyline if true that treat the points as defining a poly
line | | * @param[in] polyline if true that treat the points as defining a poly
line | |
| * instead of a polygon (default = false). | | * instead of a polygon (default = false). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| PolygonArea(const Geodesic& earth, bool polyline = false) throw() | | PolygonArea(const Geodesic& earth, bool polyline = false) throw() | |
| : _earth(earth) | | : _earth(earth) | |
| , _area0(_earth.EllipsoidArea()) | | , _area0(_earth.EllipsoidArea()) | |
| , _polyline(polyline) | | , _polyline(polyline) | |
|
| , _mask(Geodesic::LATITUDE | Geodesic::LONGITUDE | | | , _mask(Geodesic::LATITUDE | Geodesic::LONGITUDE | Geodesic::DISTANCE | |
| Geodesic::DISTANCE | (_polyline ? 0 : Geodesic::AREA)) | | | | |
| | | (_polyline ? Geodesic::NONE : Geodesic::AREA)) | |
| { Clear(); } | | { Clear(); } | |
| | | | |
| /** | | /** | |
| * Clear PolygonArea, allowing a new polygon to be started. | | * Clear PolygonArea, allowing a new polygon to be started. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| void Clear() throw() { | | void Clear() throw() { | |
| _num = 0; | | _num = 0; | |
| _crossings = 0; | | _crossings = 0; | |
| _areasum = 0; | | _areasum = 0; | |
| _perimetersum = 0; | | _perimetersum = 0; | |
| _lat0 = _lon0 = _lat1 = _lon1 = Math::NaN<real>(); | | _lat0 = _lon0 = _lat1 = _lon1 = Math::NaN<real>(); | |
| } | | } | |
| | | | |
| /** | | /** | |
| * Add a point to the polygon or polyline. | | * Add a point to the polygon or polyline. | |
| * | | * | |
| * @param[in] lat the latitude of the point (degrees). | | * @param[in] lat the latitude of the point (degrees). | |
|
| * @param[in] lon the latitude of the point (degrees). | | * @param[in] lon the longitude of the point (degrees). | |
| * | | * | |
| * \e lat should be in the range [−90°, 90°] and \e | | * \e lat should be in the range [−90°, 90°] and \e | |
| * lon should be in the range [−540°, 540°). | | * lon should be in the range [−540°, 540°). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| void AddPoint(real lat, real lon) throw(); | | void AddPoint(real lat, real lon) throw(); | |
| | | | |
| /** | | /** | |
| * Add an edge to the polygon or polyline. | | * Add an edge to the polygon or polyline. | |
| * | | * | |
| * @param[in] azi azimuth at current point (degrees). | | * @param[in] azi azimuth at current point (degrees). | |
| | | | |
| skipping to change at line 133 | | skipping to change at line 133 | |
| * Return the results so far. | | * Return the results so far. | |
| * | | * | |
| * @param[in] reverse if true then clockwise (instead of counter-clockw
ise) | | * @param[in] reverse if true then clockwise (instead of counter-clockw
ise) | |
| * traversal counts as a positive area. | | * traversal counts as a positive area. | |
| * @param[in] sign if true then return a signed result for the area if | | * @param[in] sign if true then return a signed result for the area if | |
| * the polygon is traversed in the "wrong" direction instead of retur
ning | | * the polygon is traversed in the "wrong" direction instead of retur
ning | |
| * the area for the rest of the earth. | | * the area for the rest of the earth. | |
| * @param[out] perimeter the perimeter of the polygon or length of the | | * @param[out] perimeter the perimeter of the polygon or length of the | |
| * polyline (meters). | | * polyline (meters). | |
| * @param[out] area the area of the polygon (meters<sup>2</sup>); only
set | | * @param[out] area the area of the polygon (meters<sup>2</sup>); only
set | |
|
| * if polyline is false in the constructor. | | * if \e polyline is false in the constructor. | |
| * @return the number of points. | | * @return the number of points. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| unsigned Compute(bool reverse, bool sign, | | unsigned Compute(bool reverse, bool sign, | |
| real& perimeter, real& area) const throw(); | | real& perimeter, real& area) const throw(); | |
| | | | |
| /** | | /** | |
| * Return the results assuming a tentative final test point is added; | | * Return the results assuming a tentative final test point is added; | |
| * however, the data for the test point is not saved. This lets you re
port | | * however, the data for the test point is not saved. This lets you re
port | |
| * a running result for the perimeter and area as the user moves the mo
use | | * a running result for the perimeter and area as the user moves the mo
use | |
| * cursor. Ordinary floating point arithmetic is used to accumulate th
e | | * cursor. Ordinary floating point arithmetic is used to accumulate th
e | |
| | | | |
| skipping to change at line 194 | | skipping to change at line 194 | |
| * @param[out] area the approximate area of the polygon | | * @param[out] area the approximate area of the polygon | |
| * (meters<sup>2</sup>); only set if polyline is false in the | | * (meters<sup>2</sup>); only set if polyline is false in the | |
| * constructor. | | * constructor. | |
| * @return the number of points. | | * @return the number of points. | |
| * | | * | |
| * \e azi should be in the range [−540°, 540°). | | * \e azi should be in the range [−540°, 540°). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| unsigned TestEdge(real azi, real s, bool reverse, bool sign, | | unsigned TestEdge(real azi, real s, bool reverse, bool sign, | |
| real& perimeter, real& area) const throw(); | | real& perimeter, real& area) const throw(); | |
| | | | |
|
| | | /// \cond SKIP | |
| /** | | /** | |
| * <b>DEPRECATED</b> | | * <b>DEPRECATED</b> | |
| * The old name for PolygonArea::TestPoint. | | * The old name for PolygonArea::TestPoint. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| unsigned TestCompute(real lat, real lon, bool reverse, bool sign, | | unsigned TestCompute(real lat, real lon, bool reverse, bool sign, | |
|
| real& perimeter, real& area) const throw(); | | real& perimeter, real& area) const throw() { | |
| | | return TestPoint(lat, lon, reverse, sign, perimeter, area); | |
| | | } | |
| | | /// \endcond | |
| | | | |
| /** \name Inspector functions | | /** \name Inspector functions | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| ///@{ | | ///@{ | |
| /** | | /** | |
| * @return \e a the equatorial radius of the ellipsoid (meters). This
is | | * @return \e a the equatorial radius of the ellipsoid (meters). This
is | |
| * the value inherited from the Geodesic object used in the construct
or. | | * the value inherited from the Geodesic object used in the construct
or. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| | | | |
| Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } | | Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } | |
| | | | |
| skipping to change at line 221 | | skipping to change at line 225 | |
| /** | | /** | |
| * @return \e f the flattening of the ellipsoid. This is the value | | * @return \e f the flattening of the ellipsoid. This is the value | |
| * inherited from the Geodesic object used in the constructor. | | * inherited from the Geodesic object used in the constructor. | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| Math::real Flattening() const throw() { return _earth.Flattening(); } | | Math::real Flattening() const throw() { return _earth.Flattening(); } | |
| | | | |
| /** | | /** | |
| * Report the previous vertex added to the polygon or polyline. | | * Report the previous vertex added to the polygon or polyline. | |
| * | | * | |
| * @param[out] lat the latitude of the point (degrees). | | * @param[out] lat the latitude of the point (degrees). | |
|
| * @param[out] lon the latitude of the point (degrees). | | * @param[out] lon the longitude of the point (degrees). | |
| * | | * | |
| * If no points have been added, then NaNs are returned. Otherwise, \e
lon | | * If no points have been added, then NaNs are returned. Otherwise, \e
lon | |
| * will be in the range [−180°, 180°). | | * will be in the range [−180°, 180°). | |
| **********************************************************************
/ | | **********************************************************************
/ | |
| void CurrentPoint(real& lat, real& lon) const throw() | | void CurrentPoint(real& lat, real& lon) const throw() | |
| { lat = _lat1; lon = _lon1; } | | { lat = _lat1; lon = _lon1; } | |
| ///@} | | ///@} | |
| }; | | }; | |
| | | | |
| } // namespace GeographicLib | | } // namespace GeographicLib | |
| | | | |
End of changes. 7 change blocks. |
| 7 lines changed or deleted | | 12 lines changed or added | |
|