Accumulator.hpp   Accumulator.hpp 
skipping to change at line 22 skipping to change at line 22
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief An accumulator for sums * \brief An accumulator for sums
* *
* This allow many numbers of floating point type \e T to be added togeth er * This allow many numbers of floating point type \e T to be added togeth er
* with twice the normal precision. Thus if \e T is double, the effectiv e * with twice the normal precision. Thus if \e T is double, the effectiv e
* precision of the sum is 106 bits or about 32 decimal places. The core * precision of the sum is 106 bits or about 32 decimal places.
* idea is the error free transformation of a sum, D. E. Knuth, TAOCP, Vo
l 2,
* 4.2.2, Theorem B.
* *
* The implementation follows J. R. Shewchuk, * The implementation follows J. R. Shewchuk,
* <a href="http://dx.doi.org/10.1007/PL00009321"> Adaptive Precision * <a href="http://dx.doi.org/10.1007/PL00009321"> Adaptive Precision
* Floating-Point Arithmetic and Fast Robust Geometric Predicates</a>, * Floating-Point Arithmetic and Fast Robust Geometric Predicates</a>,
* Discrete & Computational Geometry 18(3) 305--363 (1997). * Discrete & Computational Geometry 18(3) 305--363 (1997).
* *
* Approximate timings (summing a vector<double>) * Approximate timings (summing a vector<double>)
* - double: 2ns * - double: 2ns
* - Accumulator<double>: 23ns * - Accumulator<double>: 23ns
* *
skipping to change at line 46 skipping to change at line 44
* currently held in the accumulator. * currently held in the accumulator.
* *
* Example of use: * Example of use:
* \include example-Accumulator.cpp * \include example-Accumulator.cpp
**********************************************************************/ **********************************************************************/
template<typename T = Math::real> template<typename T = Math::real>
class GEOGRAPHIC_EXPORT Accumulator { class GEOGRAPHIC_EXPORT Accumulator {
private: private:
// _s + _t accumulates for the sum. // _s + _t accumulates for the sum.
T _s, _t; T _s, _t;
// Error free transformation of a sum. Note that t can be the same as // Same as Math::sum, but requires abs(u) >= abs(v). This isn't curren
one tly
// of the first two arguments. // used.
static inline T sum(T u, T v, T& t) { static inline T fastsum(T u, T v, T& t) throw() {
volatile T s = u + v;
volatile T up = s - v;
volatile T vpp = s - up;
up -= u;
vpp -= v;
t = -(up + vpp);
// u + v = s + t
// = round(u + v) + t
return s;
}
// Same as sum, but requires abs(u) >= abs(v). This isn't currently us
ed.
static inline T fastsum(T u, T v, T& t) {
volatile T s = u + v; volatile T s = u + v;
volatile T vp = s - u; volatile T vp = s - u;
t = v - vp; t = v - vp;
return s; return s;
} }
void Add(T y) throw() { void Add(T y) throw() {
// Here's Shewchuk's solution... // Here's Shewchuk's solution...
T u; // hold exact sum as [s, t, u] T u; // hold exact sum as [s, t, u]
y = sum(y, _t, u); // Accumulate starting at least significant y = Math::sum(y, _t, u); // Accumulate starting at least significan
end t end
_s = sum(y, _s, _t); _s = Math::sum(y, _s, _t);
// Start is _s, _t decreasing and non-adjacent. Sum is now (s + t + u) // Start is _s, _t decreasing and non-adjacent. Sum is now (s + t + u)
// exactly with s, t, u non-adjacent and in decreasing order (except for // exactly with s, t, u non-adjacent and in decreasing order (except for
// possible zeros). The following code tries to normalize the result . // possible zeros). The following code tries to normalize the result .
// Ideally, we want _s = round(s+t+u) and _u = round(s+t+u - _s). Th e // Ideally, we want _s = round(s+t+u) and _u = round(s+t+u - _s). Th e
// following does an approximate job (and maintains the decreasing // following does an approximate job (and maintains the decreasing
// non-adjacent property). Here are two "failures" using 3-bit float s: // non-adjacent property). Here are two "failures" using 3-bit float s:
// //
// Case 1: _s is not equal to round(s+t+u) -- off by 1 ulp // Case 1: _s is not equal to round(s+t+u) -- off by 1 ulp
// [12, -1] - 8 -> [4, 0, -1] -> [4, -1] = 3 should be [3, 0] = 3 // [12, -1] - 8 -> [4, 0, -1] -> [4, -1] = 3 should be [3, 0] = 3
// //
 End of changes. 3 change blocks. 
25 lines changed or deleted 9 lines changed or added


 AlbersEqualArea.hpp   AlbersEqualArea.hpp 
skipping to change at line 13 skipping to change at line 13
* \brief Header for GeographicLib::AlbersEqualArea class * \brief Header for GeographicLib::AlbersEqualArea class
* *
* Copyright (c) Charles Karney (2010-2012) <charles@karney.com> and licens ed * Copyright (c) Charles Karney (2010-2012) <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_ALBERSEQUALAREA_HPP) #if !defined(GEOGRAPHICLIB_ALBERSEQUALAREA_HPP)
#define GEOGRAPHICLIB_ALBERSEQUALAREA_HPP 1 #define GEOGRAPHICLIB_ALBERSEQUALAREA_HPP 1
#include <algorithm>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief Albers equal area conic projection * \brief Albers equal area conic projection
* *
* Implementation taken from the report, * Implementation taken from the report,
* - J. P. Snyder, * - J. P. Snyder,
* <a href="http://pubs.er.usgs.gov/usgspubs/pp/pp1395"> Map Projection s: A * <a href="http://pubs.er.usgs.gov/usgspubs/pp/pp1395"> Map Projection s: A
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 CassiniSoldner.hpp   CassiniSoldner.hpp 
skipping to change at line 86 skipping to change at line 86
static const real tiny_; static const real tiny_;
static const unsigned maxit_ = 10; static const unsigned maxit_ = 10;
// The following private helper functions are copied from Geodesic. // The following private helper functions are copied from Geodesic.
static inline real AngRound(real x) throw() { static inline real AngRound(real x) throw() {
// The makes the smallest gap in x = 1/16 - nextafter(1/16, 0) = 1/2^ 57 // The makes the smallest gap in x = 1/16 - nextafter(1/16, 0) = 1/2^ 57
// for reals = 0.7 pm on the earth if x is an angle in degrees. (Thi s // for reals = 0.7 pm on the earth if x is an angle in degrees. (Thi s
// is about 1000 times more resolution than we get with angles around 90 // is about 1000 times more resolution than we get with angles around 90
// degrees.) We use this to avoid having to deal with near singular // degrees.) We use this to avoid having to deal with near singular
// cases when x is non-zero but tiny (e.g., 1.0e-200). // cases when x is non-zero but tiny (e.g., 1.0e-200).
const real z = real(0.0625); // 1/16 const real z = 1/real(16);
volatile real y = std::abs(x); volatile real y = std::abs(x);
// The compiler mustn't "simplify" z - (z - y) to y // The compiler mustn't "simplify" z - (z - y) to y
y = y < z ? z - (z - y) : y; y = y < z ? z - (z - y) : y;
return x < 0 ? -y : y; return x < 0 ? -y : y;
} }
static inline void SinCosNorm(real& sinx, real& cosx) throw() { static inline void SinCosNorm(real& sinx, real& cosx) throw() {
real r = Math::hypot(sinx, cosx); real r = Math::hypot(sinx, cosx);
sinx /= r; sinx /= r;
cosx /= r; cosx /= r;
} }
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 Config.h   Config.h 
#define HAVE_LONG_DOUBLE 1 #define HAVE_LONG_DOUBLE 1
#define GEOGRAPHICLIB_VERSION_STRING "1.27" #define GEOGRAPHICLIB_VERSION_STRING "1.29"
/* # undef WORDS_BIGENDIAN */ /* # undef WORDS_BIGENDIAN */
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 Constants.hpp   Constants.hpp 
skipping to change at line 40 skipping to change at line 40
# if defined(Geographic_EXPORTS) # if defined(Geographic_EXPORTS)
# define GEOGRAPHIC_EXPORT __declspec(dllexport) # define GEOGRAPHIC_EXPORT __declspec(dllexport)
# else # else
# define GEOGRAPHIC_EXPORT __declspec(dllimport) # define GEOGRAPHIC_EXPORT __declspec(dllimport)
# endif # endif
#else #else
# define GEOGRAPHIC_EXPORT # define GEOGRAPHIC_EXPORT
#endif #endif
#include <stdexcept> #include <stdexcept>
#include <string>
#include <GeographicLib/Math.hpp> #include <GeographicLib/Math.hpp>
/** /**
* \brief Namespace for %GeographicLib * \brief Namespace for %GeographicLib
* *
* All of %GeographicLib is defined within the GeographicLib namespace. In * All of %GeographicLib is defined within the GeographicLib namespace. In
* addition all the header files are included via %GeographicLib/Class.hpp. * addition all the header files are included via %GeographicLib/Class.hpp.
* This minimizes the likelihood of conflicts with other packages. * This minimizes the likelihood of conflicts with other packages.
**********************************************************************/ **********************************************************************/
namespace GeographicLib { namespace GeographicLib {
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 DMS.hpp   DMS.hpp 
skipping to change at line 13 skipping to change at line 13
* \brief Header for GeographicLib::DMS class * \brief Header for GeographicLib::DMS class
* *
* Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens ed * Copyright (c) Charles Karney (2008-2011) <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_DMS_HPP) #if !defined(GEOGRAPHICLIB_DMS_HPP)
#define GEOGRAPHICLIB_DMS_HPP 1 #define GEOGRAPHICLIB_DMS_HPP 1
#include <sstream>
#include <iomanip>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/Utility.hpp> #include <GeographicLib/Utility.hpp>
#if defined(_MSC_VER) #if defined(_MSC_VER)
// Squelch warnings about dll vs vector and constant conditional expression s // Squelch warnings about dll vs vector and constant conditional expression s
# pragma warning (push) # pragma warning (push)
# pragma warning (disable: 4251 4127) # pragma warning (disable: 4251 4127)
#endif #endif
namespace GeographicLib { namespace GeographicLib {
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 Ellipsoid.hpp   Ellipsoid.hpp 
skipping to change at line 13 skipping to change at line 13
* \brief Header for GeographicLib::Ellipsoid class * \brief Header for GeographicLib::Ellipsoid class
* *
* Copyright (c) Charles Karney (2012) <charles@karney.com> and licensed un der * Copyright (c) Charles Karney (2012) <charles@karney.com> and licensed un der
* the MIT/X11 License. For more information, see * the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_ELLIPSOID_HPP) #if !defined(GEOGRAPHICLIB_ELLIPSOID_HPP)
#define GEOGRAPHICLIB_ELLIPSOID_HPP 1 #define GEOGRAPHICLIB_ELLIPSOID_HPP 1
#include <string>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/TransverseMercator.hpp> #include <GeographicLib/TransverseMercator.hpp>
#include <GeographicLib/EllipticFunction.hpp> #include <GeographicLib/EllipticFunction.hpp>
#include <GeographicLib/AlbersEqualArea.hpp> #include <GeographicLib/AlbersEqualArea.hpp>
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief Properties of an ellipsoid * \brief Properties of an ellipsoid
* *
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 Geocentric.hpp   Geocentric.hpp 
skipping to change at line 14 skipping to change at line 14
* *
* Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens ed * Copyright (c) Charles Karney (2008-2011) <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_GEOCENTRIC_HPP) #if !defined(GEOGRAPHICLIB_GEOCENTRIC_HPP)
#define GEOGRAPHICLIB_GEOCENTRIC_HPP 1 #define GEOGRAPHICLIB_GEOCENTRIC_HPP 1
#include <vector> #include <vector>
#include <algorithm>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief %Geocentric coordinates * \brief %Geocentric coordinates
* *
* Convert between geodetic coordinates latitude = \e lat, longitude = \e * Convert between geodetic coordinates latitude = \e lat, longitude = \e
* lon, height = \e h (measured vertically from the surface of the ellips oid) * lon, height = \e h (measured vertically from the surface of the ellips oid)
* to geocentric coordinates (\e X, \e Y, \e Z). The origin of geocentri c * to geocentric coordinates (\e X, \e Y, \e Z). The origin of geocentri c
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 Geodesic.hpp   Geodesic.hpp 
skipping to change at line 91 skipping to change at line 91
* equator to point 1. The area of this quadrilateral is represented b y \e * equator to point 1. The area of this quadrilateral is represented b y \e
* S12 with a clockwise traversal of the perimeter counting as a positi ve * S12 with a clockwise traversal of the perimeter counting as a positi ve
* area and it can be used to compute the area of any simple geodesic * area and it can be used to compute the area of any simple geodesic
* polygon. * 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. Let points 1, 2, and 3 all lie on a single geode * obey addition rules. If points 1, 2, and 3 all lie on a single geodes
sic, ic,
* then * then the following rules hold:
* - \e s13 = \e s12 + \e s23
* - \e a13 = \e a12 + \e a23
* - \e S13 = \e S12 + \e S23
* - \e m13 = \e m12 \e M23 + \e m23 \e M21 * - \e m13 = \e m12 \e M23 + \e m23 \e M21
* - \e M13 = \e M12 \e M23 &minus; (1 &minus; \e M12 \e M21) \e m23 / \e m12 * - \e M13 = \e M12 \e M23 &minus; (1 &minus; \e M12 \e M21) \e m23 / \e m12
* - \e M31 = \e M32 \e M21 &minus; (1 &minus; \e M23 \e M32) \e m12 / \e m23 * - \e M31 = \e M32 \e M21 &minus; (1 &minus; \e M23 \e M32) \e m12 / \e m23
* *
* Additional functionality is provided by the GeodesicLine class, which * Additional functionality is provided by the GeodesicLine class, which
* allows a sequence of points along a geodesic to be computed. * allows a sequence of points along a geodesic to be computed.
* *
* The shortest distance returned by the solution of the inverse problem
is
* (obviously) uniquely defined. However, in a few special cases there a
re
* multiple azimuths which yield the same shortest distance. Here is a
* catalog of those cases:
* - \e lat1 = &minus;\e lat2 (with neither at a pole). If \e azi1 = \e
* azi2, the geodesic is unique. Otherwise there are two geodesics and
the
* second one is obtained by setting [\e azi1, \e azi2] = [\e azi2, \e
* azi1], [\e M12, \e M21] = [\e M21, \e M12], \e S12 = &minus;\e S12.
* (This occurs when the longitude difference is near &plusmn;180&deg;
for
* oblate ellipsoids.)
* - \e lon2 = \e lon1 &plusmn; 180&deg; (with neither at a pole). If \e
* azi1 = 0&deg; or &plusmn;180&deg;, the geodesic is unique. Otherwis
e
* there are two geodesics and the second one is obtained by setting [\
e
* azi1, \e azi2] = [&minus;\e azi1, &minus;\e azi2], \e S12 = &minus;\
e
* S12. (This occurs when the \e lat2 is near &minus;\e lat1 for prola
te
* ellipsoids.)
* - Points 1 and 2 at opposite poles. There are infinitely many geodesi
cs
* which can be generated by setting [\e azi1, \e azi2] = [\e azi1, \e
* azi2] + [\e d, &minus;\e d], for arbitrary \e d. (For spheres, this
* prescription applies when points 1 and 2 are antipodal.)
* - s12 = 0 (coincident points). There are infinitely many geodesics wh
ich
* can be generated by setting [\e azi1, \e azi2] = [\e azi1, \e azi2]
+
* [\e d, \e d], for arbitrary \e d.
*
* The calculations are accurate to better than 15 nm (15 nanometers) for the * The calculations are accurate to better than 15 nm (15 nanometers) for the
* WGS84 ellipsoid. See Sec. 9 of * WGS84 ellipsoid. See Sec. 9 of
* <a href="http://arxiv.org/abs/1102.1215v1">arXiv:1102.1215v1</a> for * <a href="http://arxiv.org/abs/1102.1215v1">arXiv:1102.1215v1</a> for
* details. The algorithms used by this class are based on series expans ions * details. The algorithms used by this class are based on series expans ions
* using the flattening \e f as a small parameter. These only accurate f * using the flattening \e f as a small parameter. These are only accura
or te
* |\e f| &lt; 0.02; however reasonably accurate results will be obtained * for |<i>f</i>| &lt; 0.02; however reasonably accurate results will be
for * obtained for |<i>f</i>| &lt; 0.2. Here is a table of the approximate
* |\e f| &lt; 0.2. Here is a table of the approximate maximum error * maximum error (expressed as a distance) for an ellipsoid with the same
* (expressed as a distance) for an ellipsoid with the same major radius * major radius as the WGS84 ellipsoid and different values of the
as * flattening.<pre>
* the WGS84 ellipsoid and different values of the 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, 2012; * 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>.
* . * .
* For more information on geodesics see \ref geodesic. * For more information on geodesics see \ref geodesic.
* *
* Example of use: * Example of use:
* \include example-Geodesic.cpp * \include example-Geodesic.cpp
* *
skipping to change at line 182 skipping to change at line 210
static real SinCosSeries(bool sinp, static real SinCosSeries(bool sinp,
real sinx, real cosx, const real c[], int n) real sinx, real cosx, const real c[], int n)
throw(); throw();
static inline real AngRound(real x) throw() { static inline real AngRound(real x) throw() {
// The makes the smallest gap in x = 1/16 - nextafter(1/16, 0) = 1/2^ 57 // The makes the smallest gap in x = 1/16 - nextafter(1/16, 0) = 1/2^ 57
// for reals = 0.7 pm on the earth if x is an angle in degrees. (Thi s // for reals = 0.7 pm on the earth if x is an angle in degrees. (Thi s
// is about 1000 times more resolution than we get with angles around 90 // is about 1000 times more resolution than we get with angles around 90
// degrees.) We use this to avoid having to deal with near singular // degrees.) We use this to avoid having to deal with near singular
// cases when x is non-zero but tiny (e.g., 1.0e-200). // cases when x is non-zero but tiny (e.g., 1.0e-200).
const real z = real(0.0625); // 1/16 const real z = 1/real(16);
volatile real y = std::abs(x); volatile real y = std::abs(x);
// The compiler mustn't "simplify" z - (z - y) to y // The compiler mustn't "simplify" z - (z - y) to y
y = y < z ? z - (z - y) : y; y = y < z ? z - (z - y) : y;
return x < 0 ? -y : y; return x < 0 ? -y : y;
} }
static inline void SinCosNorm(real& sinx, real& cosx) throw() { static inline void SinCosNorm(real& sinx, real& cosx) throw() {
real r = Math::hypot(sinx, cosx); real r = Math::hypot(sinx, cosx);
sinx /= r; sinx /= r;
cosx /= r; cosx /= r;
} }
skipping to change at line 322 skipping to change at line 350
* @exception GeographicErr if \e a or (1 &minus; \e f ) \e a is not * @exception GeographicErr if \e a or (1 &minus; \e f ) \e a is not
* 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.
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* Perform the direct geodesic calculation where the length of the geod esic * Solve the direct geodesic problem where the length of the geodesic
* is specify in terms of distance. * is specify 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. * 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).
* @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).
* *
* \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e
* azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of * azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of
* \e lon2 and \e azi2 returned are in the range [&minus;180&deg;, * \e lon2 and \e azi2 returned are in the range [&minus;180&deg;,
* 180&deg;). * 180&deg;).
* *
* 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&deg; &minus; &epsilon; or * longitude fixed and writing \e lat = &plusmn;(90&deg; &minus; &epsil
* &minus;90&deg; + &epsilon; and taking the limit &epsilon; &rarr; 0 f on;)
rom * and taking the limit &epsilon; &rarr; 0+. An arc length greater tha
* above. An arc length greater that 180&deg; signifies a geodesic whi t
ch * 180&deg; signifies a geodesic which is not a shortest path. (For a
* is not a shortest path. (For a prolate ellipsoid, an additional * prolate ellipsoid, an additional condition is necessary for a shorte
* condition is necessary for a shortest path: the longitudinal extent st
must * path: the longitudinal extent must not exceed of 180&deg;.)
* not exceed of 180&deg;.)
* *
* 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,
real& lat2, real& lon2, real& azi2, real& lat2, real& lon2, real& azi2,
real& m12, real& M12, real& M21, real& S12) real& m12, real& M12, real& M21, real& S12)
const throw() { const throw() {
real t; real t;
skipping to change at line 437 skipping to change at line 464
LATITUDE | LONGITUDE | AZIMUTH | LATITUDE | LONGITUDE | AZIMUTH |
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 * Solve the direct geodesic problem where the length of the geodesic
* is specify in terms of arc length. * is specify 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 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).
* @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>).
* *
* \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e
* azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of * azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of
* \e lon2 and \e azi2 returned are in the range [&minus;180&deg;, * \e lon2 and \e azi2 returned are in the range [&minus;180&deg;,
* 180&deg;). * 180&deg;).
* *
* 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&deg; &minus; &epsilon; or * longitude fixed and writing \e lat = &plusmn;(90&deg; &minus; &epsil
* &minus;90&deg; + &epsilon; and taking the limit &epsilon; &rarr; 0 f on;)
rom * and taking the limit &epsilon; &rarr; 0+. An arc length greater tha
* above. An arc length greater that 180&deg; signifies a geodesic whi t
ch * 180&deg; signifies a geodesic which is not a shortest path. (For a
* is not a shortest path. (For a prolate ellipsoid, an additional * prolate ellipsoid, an additional condition is necessary for a shorte
* condition is necessary for a shortest path: the longitudinal extent st
must * path: the longitudinal extent must not exceed of 180&deg;.)
* not exceed of 180&deg;.)
* *
* 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,
real& m12, real& M12, real& M21, real& S12) real& m12, real& M12, real& M21, real& S12)
const throw() { const throw() {
GenDirect(lat1, lon1, azi1, true, a12, GenDirect(lat1, lon1, azi1, true, a12,
LATITUDE | LONGITUDE | AZIMUTH | DISTANCE | LATITUDE | LONGITUDE | AZIMUTH | DISTANCE |
skipping to change at line 561 skipping to change at line 587
REDUCEDLENGTH | GEODESICSCALE, REDUCEDLENGTH | GEODESICSCALE,
lat2, lon2, azi2, s12, m12, M12, M21, t); lat2, lon2, azi2, s12, m12, M12, M21, t);
} }
///@} ///@}
/** \name General version of the direct geodesic solution. /** \name General version of the direct geodesic solution.
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* The general direct geodesic calculation. Geodesic::Direct and * The general direct geodesic problem. Geodesic::Direct and
* Geodesic::ArcDirect are defined in terms of this function. * Geodesic::ArcDirect are defined in terms of this function.
* *
* @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] arcmode boolean flag determining the meaning of the secon * @param[in] arcmode boolean flag determining the meaning of the \e
d * s12_a12.
* parameter.
* @param[in] s12_a12 if \e arcmode is false, this is the distance betw een * @param[in] s12_a12 if \e arcmode is false, this is the distance betw een
* point 1 and point 2 (meters); otherwise it is the arc length betwe en * point 1 and point 2 (meters); otherwise it is the arc length betwe en
* point 1 and point 2 (degrees); it can be signed. * point 1 and point 2 (degrees); it can be negative.
* @param[in] outmask a bitor'ed combination of Geodesic::mask values * @param[in] outmask a bitor'ed combination of Geodesic::mask values
* specifying which of the following parameters should be set. * specifying which of the following parameters should be set.
* @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).
* @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
skipping to change at line 614 skipping to change at line 640
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,
real& s12, real& m12, real& M12, real& M21, real& s12, real& m12, real& M12, real& M21,
real& S12) const throw(); real& S12) const throw();
///@} ///@}
/** \name Inverse geodesic problem. /** \name Inverse geodesic problem.
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* Perform the inverse geodesic calculation. * Solve the inverse geodesic problem.
* *
* @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] lat2 latitude of point 2 (degrees). * @param[in] lat2 latitude of point 2 (degrees).
* @param[in] lon2 longitude of point 2 (degrees). * @param[in] lon2 longitude of 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).
* @param[out] azi1 azimuth at point 1 (degrees). * @param[out] azi1 azimuth at point 1 (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).
* @param[out] M12 geodesic scale of point 2 relative to point 1 * @param[out] M12 geodesic scale of point 2 relative to point 1
skipping to change at line 637 skipping to change at line 663
* (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 [&minus;90&deg;, 90&deg;] ; \e * \e lat1 and \e lat2 should be in the range [&minus;90&deg;, 90&deg;] ; \e
* lon1 and \e lon2 should be in the range [&minus;540&deg;, 540&deg;). * lon1 and \e lon2 should be in the range [&minus;540&deg;, 540&deg;).
* 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
* [&minus;180&deg;, 180&deg;). * [&minus;180&deg;, 180&deg;).
* *
* 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&deg; &minus; &epsilon; or * longitude fixed and writing \e lat = &plusmn;(90&deg; &minus; &epsil
* &minus;90&deg; + &epsilon; and taking the limit &epsilon; &rarr; 0 f on;)
rom * and taking the limit &epsilon; &rarr; 0+.
* above.
* *
* 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 810 skipping to change at line 835
* 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.
* . * .
* The default value of \e caps is Geodesic::ALL which turns on all the * The default value of \e caps is Geodesic::ALL which turns on all the
* capabilities. * capabilities.
* *
* If the point is at a pole, the azimuth is defined by keeping the \e lon1 * If the point is at a pole, the azimuth is defined by keeping the \e lon1
* fixed and writing \e lat1 = 90 &minus; &epsilon; or &minus;90 + * fixed and writing \e lat1 = &plusmn;&(90 &minus; &epsilon;) and taki
* &epsilon; and taking the limit &epsilon; &rarr; 0 from above. ng
* the limit &epsilon; &rarr; 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. 17 change blocks. 
47 lines changed or deleted 81 lines changed or added


 GeodesicExact.hpp   GeodesicExact.hpp 
skipping to change at line 116 skipping to change at line 116
}; };
static real CosSeries(real sinx, real cosx, const real c[], int n) static real CosSeries(real sinx, real cosx, const real c[], int n)
throw(); throw();
static inline real AngRound(real x) throw() { static inline real AngRound(real x) throw() {
// The makes the smallest gap in x = 1/16 - nextafter(1/16, 0) = 1/2^ 57 // The makes the smallest gap in x = 1/16 - nextafter(1/16, 0) = 1/2^ 57
// for reals = 0.7 pm on the earth if x is an angle in degrees. (Thi s // for reals = 0.7 pm on the earth if x is an angle in degrees. (Thi s
// is about 1000 times more resolution than we get with angles around 90 // is about 1000 times more resolution than we get with angles around 90
// degrees.) We use this to avoid having to deal with near singular // degrees.) We use this to avoid having to deal with near singular
// cases when x is non-zero but tiny (e.g., 1.0e-200). // cases when x is non-zero but tiny (e.g., 1.0e-200).
const real z = real(0.0625); // 1/16 const real z = 1/real(16);
volatile real y = std::abs(x); volatile real y = std::abs(x);
// The compiler mustn't "simplify" z - (z - y) to y // The compiler mustn't "simplify" z - (z - y) to y
y = y < z ? z - (z - y) : y; y = y < z ? z - (z - y) : y;
return x < 0 ? -y : y; return x < 0 ? -y : y;
} }
static inline void SinCosNorm(real& sinx, real& cosx) throw() { static inline void SinCosNorm(real& sinx, real& cosx) throw() {
real r = Math::hypot(sinx, cosx); real r = Math::hypot(sinx, cosx);
sinx /= r; sinx /= r;
cosx /= r; cosx /= r;
} }
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 [&minus;90&deg;, 90&deg;]; \e lon1 an d \e * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e
* azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of * azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of
* \e lon2 and \e azi2 returned are in the range [&minus;180&deg;, * \e lon2 and \e azi2 returned are in the range [&minus;180&deg;,
* 180&deg;). * 180&deg;).
* *
* 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&deg; &minus; &epsilon; or * longitude fixed and writing \e lat = &plusmn;(90&deg; &minus; &epsil
* &minus;90&deg; + &epsilon; and taking the limit &epsilon; &rarr; 0 f on;)
rom * and taking the limit &epsilon; &rarr; 0+.. An arc length greater th
* above. An arc length greater that 180&deg; signifies a geodesic whi at
ch * 180&deg; signifies a geodesic which is not a shortest path. (For a
* is not a shortest path. (For a prolate ellipsoid, an additional * prolate ellipsoid, an additional condition is necessary for a shorte
* condition is necessary for a shortest path: the longitudinal extent st
must * path: the longitudinal extent must not exceed of 180&deg;.)
* not exceed of 180&deg;.)
* *
* 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,
real& m12, real& M12, real& M21, real& S12) real& m12, real& M12, real& M21, real& S12)
const throw() { const throw() {
real t; real t;
skipping to change at line 387 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 [&minus;90&deg;, 90&deg;]; \e lon1 an d \e * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e
* azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of * azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of
* \e lon2 and \e azi2 returned are in the range [&minus;180&deg;, * \e lon2 and \e azi2 returned are in the range [&minus;180&deg;,
* 180&deg;). * 180&deg;).
* *
* 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&deg; &minus; &epsilon; or * longitude fixed and writing \e lat = &plusmn;(90&deg; &minus; &epsil
* &minus;90&deg; + &epsilon; and taking the limit &epsilon; &rarr; 0 f on;)
rom * and taking the limit &epsilon; &rarr; 0+. An arc length greater tha
* above. An arc length greater that 180&deg; signifies a geodesic whi t
ch * 180&deg; signifies a geodesic which is not a shortest path. (For a
* is not a shortest path. (For a prolate ellipsoid, an additional * prolate ellipsoid, an additional condition is necessary for a shorte
* condition is necessary for a shortest path: the longitudinal extent st
must * path: the longitudinal extent must not exceed of 180&deg;.)
* not exceed of 180&deg;.)
* *
* 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,
real& m12, real& M12, real& M21, real& S12) real& m12, real& M12, real& M21, real& S12)
const throw() { const throw() {
GenDirect(lat1, lon1, azi1, true, a12, GenDirect(lat1, lon1, azi1, true, a12,
LATITUDE | LONGITUDE | AZIMUTH | DISTANCE | LATITUDE | LONGITUDE | AZIMUTH | DISTANCE |
skipping to change at line 562 skipping to change at line 560
* (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 [&minus;90&deg;, 90&deg;] ; \e * \e lat1 and \e lat2 should be in the range [&minus;90&deg;, 90&deg;] ; \e
* lon1 and \e lon2 should be in the range [&minus;540&deg;, 540&deg;). * lon1 and \e lon2 should be in the range [&minus;540&deg;, 540&deg;).
* 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
* [&minus;180&deg;, 180&deg;). * [&minus;180&deg;, 180&deg;).
* *
* 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&deg; &minus; &epsilon; or * longitude fixed and writing \e lat = &plusmn;(90&deg; &minus; &epsil
* &minus;90&deg; + &epsilon; and taking the limit &epsilon; &rarr; 0 f on;)
rom * and taking the limit &epsilon; &rarr; 0+.
* above.
* *
* 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,
DISTANCE | AZIMUTH | DISTANCE | AZIMUTH |
 End of changes. 4 change blocks. 
23 lines changed or deleted 20 lines changed or added


 GeodesicLine.hpp   GeodesicLine.hpp 
skipping to change at line 35 skipping to change at line 35
* GeodesicLine.ArcPosition gives the position of point 2 an arc length \ e * GeodesicLine.ArcPosition gives the position of point 2 an arc length \ e
* a12 along the geodesic. * a12 along the geodesic.
* *
* The default copy constructor and assignment operators work with this * The default copy constructor and assignment operators work with this
* class. Similarly, a vector can be used to hold GeodesicLine objects. * class. Similarly, a vector can be used to hold GeodesicLine objects.
* *
* The calculations are accurate to better than 15 nm (15 nanometers). S ee * The calculations are accurate to better than 15 nm (15 nanometers). S ee
* Sec. 9 of * Sec. 9 of
* <a href="http://arxiv.org/abs/1102.1215v1">arXiv:1102.1215v1</a> for * <a href="http://arxiv.org/abs/1102.1215v1">arXiv:1102.1215v1</a> for
* details. The algorithms used by this class are based on series expans ions * details. The algorithms used by this class are based on series expans ions
* using the flattening \e f as a small parameter. These only accurate f * using the flattening \e f as a small parameter. These are only accura
or te
* |\e f| &lt; 0.02; however reasonably accurate results will be obtained * for |<i>f</i>| &lt; 0.02; however reasonably accurate results will be
for * obtained for |<i>f</i>| &lt; 0.2. For very eccentric ellipsoids, use
* |\e f| &lt; 0.2. For very eccentric ellipsoids, use GeodesicLineExact * GeodesicLineExact instead.
* 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, 2012; * 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>.
* . * .
* For more information on geodesics see \ref geodesic. * For more information on geodesics see \ref geodesic.
* *
* Example of use: * Example of use:
* \include example-GeodesicLine.cpp * \include example-GeodesicLine.cpp
* *
skipping to change at line 193 skipping to change at line 193
* 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.
* . * .
* The default value of \e caps is GeodesicLine::ALL which turns on all the * The default value of \e caps is GeodesicLine::ALL which turns on all the
* capabilities. * capabilities.
* *
* If the point is at a pole, the azimuth is defined by keeping the \e lon1 * If the point is at a pole, the azimuth is defined by keeping the \e lon1
* fixed and writing \e lat1 = 90&deg; &minus; &epsilon; or * fixed and writing \e lat1 = &plusmn;(90&deg; &minus; &epsilon;) and
* &minus;90&deg; + &epsilon; and taking the limit &epsilon; &rarr; 0 f * taking the limit &epsilon; &rarr; 0+.
rom
* above.
********************************************************************** / ********************************************************************** /
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.
********************************************************************** / ********************************************************************** /
GeodesicLine() throw() : _caps(0U) {} GeodesicLine() throw() : _caps(0U) {}
///@} ///@}
/** \name Position in terms of distance /** \name Position in terms of distance
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* Compute the position of point 2 which is a distance \e s12 (meters) * Compute the position of point 2 which is a distance \e s12 (meters)
* from point 1. from
* point 1.
* *
* @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. * 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); requires that the * @param[out] lon2 longitude of point 2 (degrees); requires that the
* GeodesicLine object was constructed with \e caps |= * GeodesicLine object was constructed with \e caps |=
* GeodesicLine::LONGITUDE. * GeodesicLine::LONGITUDE.
* @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); requires that t he * @param[out] m12 reduced length of geodesic (meters); requires that t he
* GeodesicLine object was constructed with \e caps |= * GeodesicLine object was constructed with \e caps |=
* GeodesicLine::REDUCEDLENGTH. * GeodesicLine::REDUCEDLENGTH.
* @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); requires that the GeodesicLine object was constru cted * (dimensionless); requires that the GeodesicLine object was constru cted
skipping to change at line 335 skipping to change at line 334
/** \name Position in terms of arc length /** \name Position in terms of arc length
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* Compute the position of point 2 which is an arc length \e a12 (degre es) * Compute the position of point 2 which is an arc length \e a12 (degre es)
* from point 1. * from point 1.
* *
* @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 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); requires that the * @param[out] lon2 longitude of point 2 (degrees); requires that the
* GeodesicLine object was constructed with \e caps |= * GeodesicLine object was constructed with \e caps |=
* GeodesicLine::LONGITUDE. * GeodesicLine::LONGITUDE.
* @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); requi res * @param[out] s12 distance between point 1 and point 2 (meters); requi res
* that the GeodesicLine object was constructed with \e caps |= * that the GeodesicLine object was constructed with \e caps |=
* GeodesicLine::DISTANCE. * GeodesicLine::DISTANCE.
* @param[out] m12 reduced length of geodesic (meters); requires that t he * @param[out] m12 reduced length of geodesic (meters); requires that t he
* GeodesicLine object was constructed with \e caps |= * GeodesicLine object was constructed with \e caps |=
skipping to change at line 462 skipping to change at line 461
/** /**
* The general position function. GeodesicLine::Position and * The general position function. GeodesicLine::Position and
* GeodesicLine::ArcPosition are defined in terms of this function. * GeodesicLine::ArcPosition are defined in terms of this function.
* *
* @param[in] arcmode boolean flag determining the meaning of the secon d * @param[in] arcmode boolean flag determining the meaning of the secon d
* parameter; if arcmode is false, then the GeodesicLine object must have * parameter; if arcmode is false, then the GeodesicLine object must have
* been constructed with \e caps |= GeodesicLine::DISTANCE_IN. * been constructed with \e caps |= GeodesicLine::DISTANCE_IN.
* @param[in] s12_a12 if \e arcmode is false, this is the distance betw een * @param[in] s12_a12 if \e arcmode is false, this is the distance betw een
* point 1 and point 2 (meters); otherwise it is the arc length betwe en * point 1 and point 2 (meters); otherwise it is the arc length betwe en
* point 1 and point 2 (degrees); it can be signed. * point 1 and point 2 (degrees); it can be negative.
* @param[in] outmask a bitor'ed combination of GeodesicLine::mask valu es * @param[in] outmask a bitor'ed combination of GeodesicLine::mask valu es
* specifying which of the following parameters should be set. * specifying which of the following parameters should be set.
* @param[out] lat2 latitude of point 2 (degrees). * @param[out] lat2 latitude of point 2 (degrees).
* @param[out] lon2 longitude of point 2 (degrees); requires that the * @param[out] lon2 longitude of point 2 (degrees); requires that the
* GeodesicLine object was constructed with \e caps |= * GeodesicLine object was constructed with \e caps |=
* GeodesicLine::LONGITUDE. * GeodesicLine::LONGITUDE.
* @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); requi res * @param[out] s12 distance between point 1 and point 2 (meters); requi res
* that the GeodesicLine object was constructed with \e caps |= * that the GeodesicLine object was constructed with \e caps |=
* GeodesicLine::DISTANCE. * GeodesicLine::DISTANCE.
 End of changes. 7 change blocks. 
16 lines changed or deleted 14 lines changed or added


 GeodesicLineExact.hpp   GeodesicLineExact.hpp 
skipping to change at line 166 skipping to change at line 166
* 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.
* . * .
* The default value of \e caps is GeodesicLineExact::ALL which turns o n * The default value of \e caps is GeodesicLineExact::ALL which turns o n
* all the capabilities. * all the capabilities.
* *
* If the point is at a pole, the azimuth is defined by keeping the \e lon1 * If the point is at a pole, the azimuth is defined by keeping the \e lon1
* fixed and writing \e lat1 = 90&deg; &minus; &epsilon; or * fixed and writing \e lat1 = &plusmn;(90&deg; &minus; &epsilon;) and
* &minus;90&deg; + &epsilon; and taking the limit &epsilon; &rarr; 0 f * taking the limit &epsilon; &rarr; 0+.
rom
* above.
********************************************************************** / ********************************************************************** /
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
 End of changes. 1 change blocks. 
4 lines changed or deleted 2 lines changed or added


 Geohash.hpp   Geohash.hpp 
skipping to change at line 13 skipping to change at line 13
* \brief Header for GeographicLib::Geohash class * \brief Header for GeographicLib::Geohash class
* *
* Copyright (c) Charles Karney (2012) <charles@karney.com> and licensed un der * Copyright (c) Charles Karney (2012) <charles@karney.com> and licensed un der
* the MIT/X11 License. For more information, see * the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_GEOHASH_HPP) #if !defined(GEOGRAPHICLIB_GEOHASH_HPP)
#define GEOGRAPHICLIB_GEOHASH_HPP 1 #define GEOGRAPHICLIB_GEOHASH_HPP 1
#include <string>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#if defined(_MSC_VER) #if defined(_MSC_VER)
// Squelch warnings about dll vs string // Squelch warnings about dll vs string
# pragma warning (push) # pragma warning (push)
# pragma warning (disable: 4251) # pragma warning (disable: 4251)
#endif #endif
namespace GeographicLib { namespace GeographicLib {
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 Geoid.hpp   Geoid.hpp 
skipping to change at line 13 skipping to change at line 13
* \brief Header for GeographicLib::Geoid class * \brief Header for GeographicLib::Geoid class
* *
* Copyright (c) Charles Karney (2009-2012) <charles@karney.com> and licens ed * Copyright (c) Charles Karney (2009-2012) <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_GEOID_HPP) #if !defined(GEOGRAPHICLIB_GEOID_HPP)
#define GEOGRAPHICLIB_GEOID_HPP 1 #define GEOGRAPHICLIB_GEOID_HPP 1
#include <string>
#include <vector> #include <vector>
#include <fstream> #include <fstream>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#if defined(_MSC_VER) #if defined(_MSC_VER)
// Squelch warnings about dll vs vector and constant conditional expression s // Squelch warnings about dll vs vector and constant conditional expression s
# pragma warning (push) # pragma warning (push)
# pragma warning (disable: 4251 4127) # pragma warning (disable: 4251 4127)
#endif #endif
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 Gnomonic.hpp   Gnomonic.hpp 
skipping to change at line 27 skipping to change at line 27
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief %Gnomonic projection * \brief %Gnomonic projection
* *
* %Gnomonic projection centered at an arbitrary position \e C on the * %Gnomonic projection centered at an arbitrary position \e C on the
* ellipsoid. This projection is derived in Section 8 of * ellipsoid. This projection is derived in Section 8 of
* - 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, 2012; * 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>.
* . * .
* The projection of \e P is defined as follows: compute the geodesic lin e * The projection of \e P is defined as follows: compute the geodesic lin e
* from \e C to \e P; compute the reduced length \e m12, geodesic scale \ e * from \e C to \e P; compute the reduced length \e m12, geodesic scale \ e
* M12, and &rho; = <i>m12</i>/\e M12; finally \e x = &rho; sin \e azi1; \e * M12, and &rho; = <i>m12</i>/\e M12; finally \e x = &rho; sin \e azi1; \e
* y = &rho; cos \e azi1, where \e azi1 is the azimuth of the geodesic at \e * y = &rho; cos \e azi1, where \e azi1 is the azimuth of the geodesic at \e
* C. The Gnomonic::Forward and Gnomonic::Reverse methods also return th e * C. The Gnomonic::Forward and Gnomonic::Reverse methods also return th e
skipping to change at line 108 skipping to change at line 108
* and CassiniSoldner. * and CassiniSoldner.
**********************************************************************/ **********************************************************************/
class GEOGRAPHIC_EXPORT Gnomonic { class GEOGRAPHIC_EXPORT Gnomonic {
private: private:
typedef Math::real real; typedef Math::real real;
Geodesic _earth; Geodesic _earth;
real _a, _f; real _a, _f;
static const real eps0_; static const real eps0_;
static const real eps_; static const real eps_;
static const int numit_ = 5; static const int numit_ = 10;
public: public:
/** /**
* Constructor for Gnomonic. * Constructor for Gnomonic.
* *
* @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.
********************************************************************** / ********************************************************************** /
explicit Gnomonic(const Geodesic& earth = Geodesic::WGS84) explicit Gnomonic(const Geodesic& earth = Geodesic::WGS84)
throw() throw()
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 GravityCircle.hpp   GravityCircle.hpp 
skipping to change at line 13 skipping to change at line 13
* \brief Header for GeographicLib::GravityCircle class * \brief Header for GeographicLib::GravityCircle class
* *
* Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un der * Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un der
* the MIT/X11 License. For more information, see * the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_GRAVITYCIRCLE_HPP) #if !defined(GEOGRAPHICLIB_GRAVITYCIRCLE_HPP)
#define GEOGRAPHICLIB_GRAVITYCIRCLE_HPP 1 #define GEOGRAPHICLIB_GRAVITYCIRCLE_HPP 1
#include <string>
#include <vector> #include <vector>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/CircularEngine.hpp> #include <GeographicLib/CircularEngine.hpp>
#include <GeographicLib/GravityModel.hpp> #include <GeographicLib/GravityModel.hpp>
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief Gravity on a circle of latitude * \brief Gravity on a circle of latitude
* *
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 GravityModel.hpp   GravityModel.hpp 
skipping to change at line 13 skipping to change at line 13
* \brief Header for GeographicLib::GravityModel class * \brief Header for GeographicLib::GravityModel class
* *
* Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un der * Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un der
* the MIT/X11 License. For more information, see * the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_GRAVITYMODEL_HPP) #if !defined(GEOGRAPHICLIB_GRAVITYMODEL_HPP)
#define GEOGRAPHICLIB_GRAVITYMODEL_HPP 1 #define GEOGRAPHICLIB_GRAVITYMODEL_HPP 1
#include <string>
#include <sstream>
#include <vector>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/NormalGravity.hpp> #include <GeographicLib/NormalGravity.hpp>
#include <GeographicLib/SphericalHarmonic.hpp> #include <GeographicLib/SphericalHarmonic.hpp>
#include <GeographicLib/SphericalHarmonic1.hpp> #include <GeographicLib/SphericalHarmonic1.hpp>
#if defined(_MSC_VER) #if defined(_MSC_VER)
// Squelch warnings about dll vs vector // Squelch warnings about dll vs vector
# pragma warning (push) # pragma warning (push)
# pragma warning (disable: 4251) # pragma warning (disable: 4251)
#endif #endif
 End of changes. 1 change blocks. 
3 lines changed or deleted 0 lines changed or added


 LambertConformalConic.hpp   LambertConformalConic.hpp 
skipping to change at line 13 skipping to change at line 13
* \brief Header for GeographicLib::LambertConformalConic class * \brief Header for GeographicLib::LambertConformalConic class
* *
* Copyright (c) Charles Karney (2010-2012) <charles@karney.com> and licens ed * Copyright (c) Charles Karney (2010-2012) <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_LAMBERTCONFORMALCONIC_HPP) #if !defined(GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP)
#define GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP 1 #define GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP 1
#include <algorithm>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief Lambert conformal conic projection * \brief Lambert conformal conic projection
* *
* Implementation taken from the report, * Implementation taken from the report,
* - J. P. Snyder, * - J. P. Snyder,
* <a href="http://pubs.er.usgs.gov/usgspubs/pp/pp1395"> Map Projection s: A * <a href="http://pubs.er.usgs.gov/usgspubs/pp/pp1395"> Map Projection s: A
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 MGRS.hpp   MGRS.hpp 
skipping to change at line 13 skipping to change at line 13
* \brief Header for GeographicLib::MGRS class * \brief Header for GeographicLib::MGRS class
* *
* Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens ed * Copyright (c) Charles Karney (2008-2011) <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_MGRS_HPP) #if !defined(GEOGRAPHICLIB_MGRS_HPP)
#define GEOGRAPHICLIB_MGRS_HPP 1 #define GEOGRAPHICLIB_MGRS_HPP 1
#include <sstream>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/UTMUPS.hpp> #include <GeographicLib/UTMUPS.hpp>
#if defined(_MSC_VER) #if defined(_MSC_VER)
// Squelch warnings about dll vs string // Squelch warnings about dll vs string
# pragma warning (push) # pragma warning (push)
# pragma warning (disable: 4251) # pragma warning (disable: 4251)
#endif #endif
namespace GeographicLib { namespace GeographicLib {
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 MagneticCircle.hpp   MagneticCircle.hpp 
skipping to change at line 13 skipping to change at line 13
* \brief Header for GeographicLib::MagneticCircle class * \brief Header for GeographicLib::MagneticCircle class
* *
* Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un der * Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un der
* the MIT/X11 License. For more information, see * the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_MAGNETICCIRCLE_HPP) #if !defined(GEOGRAPHICLIB_MAGNETICCIRCLE_HPP)
#define GEOGRAPHICLIB_MAGNETICCIRCLE_HPP 1 #define GEOGRAPHICLIB_MAGNETICCIRCLE_HPP 1
#include <string>
#include <vector> #include <vector>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/CircularEngine.hpp> #include <GeographicLib/CircularEngine.hpp>
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief Geomagnetic field on a circle of latitude * \brief Geomagnetic field on a circle of latitude
* *
* Evaluate the earth's magnetic field on a circle of constant height and * Evaluate the earth's magnetic field on a circle of constant height and
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 MagneticModel.hpp   MagneticModel.hpp 
skipping to change at line 13 skipping to change at line 13
* \brief Header for GeographicLib::MagneticModel class * \brief Header for GeographicLib::MagneticModel class
* *
* Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un der * Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un der
* the MIT/X11 License. For more information, see * the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_MAGNETICMODEL_HPP) #if !defined(GEOGRAPHICLIB_MAGNETICMODEL_HPP)
#define GEOGRAPHICLIB_MAGNETICMODEL_HPP 1 #define GEOGRAPHICLIB_MAGNETICMODEL_HPP 1
#include <string>
#include <sstream>
#include <vector>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/Geocentric.hpp> #include <GeographicLib/Geocentric.hpp>
#include <GeographicLib/SphericalHarmonic.hpp> #include <GeographicLib/SphericalHarmonic.hpp>
#if defined(_MSC_VER) #if defined(_MSC_VER)
// Squelch warnings about dll vs vector // Squelch warnings about dll vs vector
# pragma warning (push) # pragma warning (push)
# pragma warning (disable: 4251) # pragma warning (disable: 4251)
#endif #endif
 End of changes. 1 change blocks. 
3 lines changed or deleted 0 lines changed or added


 Math.hpp   Math.hpp 
skipping to change at line 49 skipping to change at line 49
* float (single precision); 2 (the default) means double; 3 means long dou ble; * float (single precision); 2 (the default) means double; 3 means long dou ble;
* 4 is reserved for quadruple precision. Nearly all the testing has been * 4 is reserved for quadruple precision. Nearly all the testing has been
* carried out with doubles and that's the recommended configuration. In o rder * carried out with doubles and that's the recommended configuration. In o rder
* for long double to be used, HAVE_LONG_DOUBLE needs to be defined. Note that * for long double to be used, HAVE_LONG_DOUBLE needs to be defined. Note that
* with Microsoft Visual Studio, long double is the same as double. * with Microsoft Visual Studio, long double is the same as double.
**********************************************************************/ **********************************************************************/
# define GEOGRAPHICLIB_PRECISION 2 # define GEOGRAPHICLIB_PRECISION 2
#endif #endif
#include <cmath> #include <cmath>
#include <limits>
#include <algorithm> #include <algorithm>
#include <vector> #include <limits>
#if defined(_LIBCPP_VERSION)
#include <type_traits>
#endif
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief Mathematical functions needed by %GeographicLib * \brief Mathematical functions needed by %GeographicLib
* *
* Define mathematical functions in order to localize system dependencies and * Define mathematical functions in order to localize system dependencies and
* to provide generic versions of the functions. In addition define a re al * to provide generic versions of the functions. In addition define a re al
* type to be used by %GeographicLib. * type to be used by %GeographicLib.
* *
skipping to change at line 329 skipping to change at line 331
{ return std::cbrt(x); } { return std::cbrt(x); }
#else #else
static inline double cbrt(double x) throw() { return ::cbrt(x); } static inline double cbrt(double x) throw() { return ::cbrt(x); }
static inline float cbrt(float x) throw() { return ::cbrtf(x); } static inline float cbrt(float x) throw() { return ::cbrtf(x); }
# if HAVE_LONG_DOUBLE # if HAVE_LONG_DOUBLE
static inline long double cbrt(long double x) throw() { return ::cbrtl( x); } static inline long double cbrt(long double x) throw() { return ::cbrtl( x); }
# endif # endif
#endif #endif
/** /**
* The error-free sum of two numbers.
*
* @tparam T the type of the argument and the returned value.
* @param[in] u
* @param[in] v
* @param[out] t the exact error given by (\e u + \e v) - \e s.
* @return \e s = round(\e u + \e v).
*
* See D. E. Knuth, TAOCP, Vol 2, 4.2.2, Theorem B. (Note that \e t ca
n be
* the same as one of the first two arguments.)
**********************************************************************
/
template<typename T> static inline T sum(T u, T v, T& t) throw() {
volatile T s = u + v;
volatile T up = s - v;
volatile T vpp = s - up;
up -= u;
vpp -= v;
t = -(up + vpp);
// u + v = s + t
// = round(u + v) + t
return s;
}
/**
* Normalize an angle (restricted input range). * Normalize an angle (restricted input range).
* *
* @tparam T the type of the argument and returned value. * @tparam T the type of the argument and returned value.
* @param[in] x the angle in degrees. * @param[in] x the angle in degrees.
* @return the angle reduced to the range [&minus;180&deg;, * @return the angle reduced to the range [&minus;180&deg;,
* 180&deg;). * 180&deg;).
* *
* \e x must lie in [&minus;540&deg;, 540&deg;). * \e x must lie in [&minus;540&deg;, 540&deg;).
********************************************************************** / ********************************************************************** /
template<typename T> static inline T AngNormalize(T x) throw() template<typename T> static inline T AngNormalize(T x) throw()
skipping to change at line 355 skipping to change at line 381
* @param[in] x the angle in degrees. * @param[in] x the angle in degrees.
* @return the angle reduced to the range [&minus;180&deg;, * @return the angle reduced to the range [&minus;180&deg;,
* 180&deg;). * 180&deg;).
* *
* The range of \e x is unrestricted. * The range of \e x is unrestricted.
********************************************************************** / ********************************************************************** /
template<typename T> static inline T AngNormalize2(T x) throw() template<typename T> static inline T AngNormalize2(T x) throw()
{ return AngNormalize<T>(std::fmod(x, T(360))); } { return AngNormalize<T>(std::fmod(x, T(360))); }
/** /**
* Difference of two angles reduced to [&minus;180&deg;, 180&deg;]
*
* @tparam T the type of the arguments and returned value.
* @param[in] x the first angle in degrees.
* @param[in] y the second angle in degrees.
* @return \e y &minus; \e x, reduced to the range [&minus;180&deg;,
* 180&deg;].
*
* \e x and \e y must both lie in [&minus;180&deg;, 180&deg;]. The res
ult
* is equivalent to computing the difference exactly, reducing it to
* (&minus;180&deg;, 180&deg;] and rounding the result. Note that this
* prescription allows &minus;180&deg; to be returned (e.g., if \e x is
* tiny and negative and \e y = 180&deg;).
**********************************************************************
/
template<typename T> static inline T AngDiff(T x, T y) throw() {
T t, d = sum(-x, y, t);
if ((d - T(180)) + t > T(0)) // y - x > 180
d -= T(360); // exact
else if ((d + T(180)) + t <= T(0)) // y - x <= -180
d += T(360); // exact
return d + t;
}
#if defined(DOXYGEN)
/**
* Test for finiteness. * Test for finiteness.
* *
* @tparam T the type of the argument. * @tparam T the type of the argument.
* @param[in] x * @param[in] x
* @return true if number is finite, false if NaN or infinite. * @return true if number is finite, false if NaN or infinite.
********************************************************************** / ********************************************************************** /
template<typename T> static inline bool isfinite(T x) throw() { template<typename T> static inline bool isfinite(T x) throw() {
#if defined(DOXYGEN)
return std::abs(x) <= (std::numeric_limits<T>::max)(); return std::abs(x) <= (std::numeric_limits<T>::max)();
}
#elif (defined(_MSC_VER) && !GEOGRAPHICLIB_CPLUSPLUS11_MATH) #elif (defined(_MSC_VER) && !GEOGRAPHICLIB_CPLUSPLUS11_MATH)
template<typename T> static inline bool isfinite(T x) throw() {
return _finite(double(x)) != 0; return _finite(double(x)) != 0;
}
#elif defined(_LIBCPP_VERSION)
// libc++ implements std::isfinite() as a template that only allows
// floating-point types. isfinite is invoked by Utility::str to format
// numbers conveniently and this allows integer arguments, so we need t
o
// allow Math::isfinite to work on integers.
template<typename T> static inline
typename std::enable_if<std::is_floating_point<T>::value, bool>::type
isfinite(T x) throw() {
return std::isfinite(x);
}
template<typename T> static inline
typename std::enable_if<!std::is_floating_point<T>::value, bool>::type
isfinite(T /*x*/) throw() {
return true;
}
#else #else
template<typename T> static inline bool isfinite(T x) throw() {
return std::isfinite(x); return std::isfinite(x);
#endif
} }
#endif
/** /**
* The NaN (not a number) * The NaN (not a number)
* *
* @tparam T the type of the returned value. * @tparam T the type of the returned value.
* @return NaN if available, otherwise return the max real of type T. * @return NaN if available, otherwise return the max real of type T.
********************************************************************** / ********************************************************************** /
template<typename T> static inline T NaN() throw() { template<typename T> static inline T NaN() throw() {
return std::numeric_limits<T>::has_quiet_NaN ? return std::numeric_limits<T>::has_quiet_NaN ?
std::numeric_limits<T>::quiet_NaN() : std::numeric_limits<T>::quiet_NaN() :
 End of changes. 11 change blocks. 
4 lines changed or deleted 78 lines changed or added


 OSGB.hpp   OSGB.hpp 
skipping to change at line 13 skipping to change at line 13
* \brief Header for GeographicLib::OSGB class * \brief Header for GeographicLib::OSGB class
* *
* Copyright (c) Charles Karney (2010-2011) <charles@karney.com> and licens ed * Copyright (c) Charles Karney (2010-2011) <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_OSGB_HPP) #if !defined(GEOGRAPHICLIB_OSGB_HPP)
#define GEOGRAPHICLIB_OSGB_HPP 1 #define GEOGRAPHICLIB_OSGB_HPP 1
#include <string>
#include <sstream>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/TransverseMercator.hpp> #include <GeographicLib/TransverseMercator.hpp>
#if defined(_MSC_VER) #if defined(_MSC_VER)
// Squelch warnings about dll vs string // Squelch warnings about dll vs string
# pragma warning (push) # pragma warning (push)
# pragma warning (disable: 4251) # pragma warning (disable: 4251)
#endif #endif
namespace GeographicLib { namespace GeographicLib {
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 PolygonArea.hpp   PolygonArea.hpp 
skipping to change at line 27 skipping to change at line 27
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief Polygon areas * \brief Polygon areas
* *
* This computes the area of a geodesic polygon using the method given * This computes the area of a geodesic polygon using the method given
* Section 6 of * Section 6 of
* - 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, 2012; * 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>.
* *
* This class lets you add vertices one at a time to the polygon. The ar ea * This class lets you add vertices one at a time to the polygon. The ar ea
* and perimeter are accumulated in two times the standard floating point * and perimeter are accumulated in two times the standard floating point
* precision to guard against the loss of accuracy with many-sided polygo ns. * precision to guard against the loss of accuracy with many-sided polygo ns.
* At any point you can ask for the perimeter and area so far. There's a n * At any point you can ask for the perimeter and area so far. There's a n
* option to treat the points as defining a polyline instead of a polygon ; in * option to treat the points as defining a polyline instead of a polygon ; in
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;
// Copied from Geodesic class (now the Math class)
static inline real AngNormalize(real x) throw() {
// Place angle in [-180, 180). Assumes x is in [-540, 540).
//
// g++ 4.4.4 holds a temporary in an extended register causing an err
or
// with the triangle 89,0.1;89,90.1;89,-179.9. The volatile declarat
ion
// fixes this. (The bug probably triggered because transit and
// AngNormalize are inline functions. So don't port this change over
to
// Geodesic.hpp.)
volatile real y = x;
return y >= 180 ? y - 360 : (y < -180 ? y + 360 : y);
}
static inline int transit(real lon1, real lon2) { static inline int transit(real lon1, real lon2) {
// 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.
lon1 = AngNormalize(lon1); // Compute lon12 the same way as Geodesic::Inverse.
lon2 = AngNormalize(lon2); lon1 = Math::AngNormalize(lon1);
// treat lon12 = -180 as an eastward geodesic, so convert to 180. lon2 = Math::AngNormalize(lon2);
real lon12 = -AngNormalize(lon1 - lon2); // In (-180, 180] 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;
} }
public: public:
/** /**
* Constructor for PolygonArea. * Constructor for PolygonArea.
* *
 End of changes. 3 change blocks. 
20 lines changed or deleted 5 lines changed or added


 UTMUPS.hpp   UTMUPS.hpp 
skipping to change at line 13 skipping to change at line 13
* \brief Header for GeographicLib::UTMUPS class * \brief Header for GeographicLib::UTMUPS class
* *
* Copyright (c) Charles Karney (2008-2011) <charles@karney.com> and licens ed * Copyright (c) Charles Karney (2008-2011) <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_UTMUPS_HPP) #if !defined(GEOGRAPHICLIB_UTMUPS_HPP)
#define GEOGRAPHICLIB_UTMUPS_HPP 1 #define GEOGRAPHICLIB_UTMUPS_HPP 1
#include <sstream>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief Convert between geographic coordinates and UTM/UPS * \brief Convert between geographic coordinates and UTM/UPS
* *
* UTM and UPS are defined * UTM and UPS are defined
* - J. W. Hager, J. F. Behensky, and B. W. Drew, * - J. W. Hager, J. F. Behensky, and B. W. Drew,
* <a href="http://earth-info.nga.mil/GandG/publications/tm8358.2/TM835 8_2.pdf"> * <a href="http://earth-info.nga.mil/GandG/publications/tm8358.2/TM835 8_2.pdf">
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 Utility.hpp   Utility.hpp 
skipping to change at line 16 skipping to change at line 16
* 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_UTILITY_HPP) #if !defined(GEOGRAPHICLIB_UTILITY_HPP)
#define GEOGRAPHICLIB_UTILITY_HPP 1 #define GEOGRAPHICLIB_UTILITY_HPP 1
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <iomanip> #include <iomanip>
#include <vector> #include <vector>
#include <string>
#include <sstream> #include <sstream>
#include <algorithm>
#include <cctype> #include <cctype>
#if defined(_MSC_VER) #if defined(_MSC_VER)
// Squelch warnings about constant conditional expressions // Squelch warnings about constant conditional expressions
# pragma warning (push) # pragma warning (push)
# pragma warning (disable: 4127) # pragma warning (disable: 4127)
#endif #endif
namespace GeographicLib { namespace GeographicLib {
skipping to change at line 312 skipping to change at line 310
if (x == 0) if (x == 0)
throw GeographicErr(errmsg); throw GeographicErr(errmsg);
return x; return x;
} }
/** /**
* Match "nan" and "inf" (and variants thereof) in a string. * Match "nan" and "inf" (and variants thereof) in a string.
* *
* @tparam T the type of the return value. * @tparam T the type of the return value.
* @param[in] s the string to be matched. * @param[in] s the string to be matched.
* @return appropriate special value (&plusmn;&infin;, nan) or 0 is non e is * @return appropriate special value (&plusmn;&infin;, nan) or 0 if non e is
* found. * found.
********************************************************************** / ********************************************************************** /
template<typename T> static T nummatch(const std::string& s) { template<typename T> static T nummatch(const std::string& s) {
if (s.length() < 3) if (s.length() < 3)
return 0; return 0;
std::string t; std::string t;
t.resize(s.length()); t.resize(s.length());
std::transform(s.begin(), s.end(), t.begin(), (int(*)(int))std::toupp er); std::transform(s.begin(), s.end(), t.begin(), (int(*)(int))std::toupp er);
for (size_t i = s.length(); i--;) for (size_t i = s.length(); i--;)
t[i] = char(std::toupper(s[i])); t[i] = char(std::toupper(s[i]));
 End of changes. 3 change blocks. 
3 lines changed or deleted 1 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/