Accumulator.hpp   Accumulator.hpp 
skipping to change at line 25 skipping to change at line 25
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. * precision of the sum is 106 bits or about 32 decimal places.
* *
* 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="https://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
* *
* In the documentation of the member functions, \e sum stands for the va lue * In the documentation of the member functions, \e sum stands for the va lue
* currently held in the accumulator. * currently held in the accumulator.
* *
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 AlbersEqualArea.hpp   AlbersEqualArea.hpp 
skipping to change at line 91 skipping to change at line 91
} }
// return atanh(sqrt(x))/sqrt(x) - 1, accurate for small x // return atanh(sqrt(x))/sqrt(x) - 1, accurate for small x
static real atanhxm1(real x); static real atanhxm1(real x);
// Divided differences // Divided differences
// Definition: Df(x,y) = (f(x)-f(y))/(x-y) // Definition: Df(x,y) = (f(x)-f(y))/(x-y)
// See: // See:
// W. M. Kahan and R. J. Fateman, // W. M. Kahan and R. J. Fateman,
// Symbolic computation of divided differences, // Symbolic computation of divided differences,
// SIGSAM Bull. 33(3), 7-28 (1999) // SIGSAM Bull. 33(3), 7-28 (1999)
// http://dx.doi.org/10.1145/334714.334716 // https://dx.doi.org/10.1145/334714.334716
// http://www.cs.berkeley.edu/~fateman/papers/divdiff.pdf // http://www.cs.berkeley.edu/~fateman/papers/divdiff.pdf
// //
// General rules // General rules
// h(x) = f(g(x)): Dh(x,y) = Df(g(x),g(y))*Dg(x,y) // h(x) = f(g(x)): Dh(x,y) = Df(g(x),g(y))*Dg(x,y)
// h(x) = f(x)*g(x): // h(x) = f(x)*g(x):
// Dh(x,y) = Df(x,y)*g(x) + Dg(x,y)*f(y) // Dh(x,y) = Df(x,y)*g(x) + Dg(x,y)*f(y)
// = Df(x,y)*g(y) + Dg(x,y)*f(x) // = Df(x,y)*g(y) + Dg(x,y)*f(x)
// = Df(x,y)*(g(x)+g(y))/2 + Dg(x,y)*(f(x)+f(y))/2 // = Df(x,y)*(g(x)+g(y))/2 + Dg(x,y)*(f(x)+f(y))/2
// //
// sn(x) = x/sqrt(1+x^2): Dsn(x,y) = (x+y)/((sn(x)+sn(y))*(1+x^2)*(1+y^ 2)) // sn(x) = x/sqrt(1+x^2): Dsn(x,y) = (x+y)/((sn(x)+sn(y))*(1+x^2)*(1+y^ 2))
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 Config.h   Config.h 
#define GEOGRAPHICLIB_VERSION_MAJOR 1 #define GEOGRAPHICLIB_VERSION_MAJOR 1
#define GEOGRAPHICLIB_VERSION_MINOR 39 #define GEOGRAPHICLIB_VERSION_MINOR 39
#define GEOGRAPHICLIB_VERSION_PATCH 0 #define GEOGRAPHICLIB_VERSION_PATCH 0
#define GEOGRAPHICLIB_HAVE_LONG_DOUBLE 1 #define GEOGRAPHICLIB_HAVE_LONG_DOUBLE 1
#define GEOGRAPHICLIB_VERSION_STRING "1.39" #define GEOGRAPHICLIB_VERSION_STRING "1.40"
/* # undef GEOGRAPHICLIB_WORDS_BIGENDIAN */ /* # undef GEOGRAPHICLIB_WORDS_BIGENDIAN */
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 DMS.hpp   DMS.hpp 
/** /**
* \file DMS.hpp * \file DMS.hpp
* \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-2014) <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 <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/Utility.hpp> #include <GeographicLib/Utility.hpp>
skipping to change at line 123 skipping to change at line 123
* *
* @param[in] dms string input. * @param[in] dms string input.
* @param[out] ind a DMS::flag value signaling the presence of a * @param[out] ind a DMS::flag value signaling the presence of a
* hemisphere indicator. * hemisphere indicator.
* @exception GeographicErr if \e dms is malformed (see below). * @exception GeographicErr if \e dms is malformed (see below).
* @return angle (degrees). * @return angle (degrees).
* *
* Degrees, minutes, and seconds are indicated by the characters d, ' * Degrees, minutes, and seconds are indicated by the characters d, '
* (single quote), &quot; (double quote), and these components may only be * (single quote), &quot; (double quote), and these components may only be
* given in this order. Any (but not all) components may be omitted an d * given in this order. Any (but not all) components may be omitted an d
* other symbols (e.g., the &deg; symbol for degrees and the unicode * other symbols (e.g., the &deg; symbol for degrees and the unicode pr
* prime and double prime symbols for minutes and seconds) may be ime
* substituted. The last component indicator may be omitted and is ass * and double prime symbols for minutes and seconds) may be substituted
umed ;
* to be the next smallest unit (thus 33d10 is interpreted as 33d10'). * two single quotes can be used instead of &quot;. The last component
The * indicator may be omitted and is assumed to be the next smallest unit
* final component may be a decimal fraction but the non-final componen * (thus 33d10 is interpreted as 33d10'). The final component may be a
ts * decimal fraction but the non-final components must be integers. Ins
* must be integers. Instead of using d, ', and &quot; to indicate tead
* degrees, minutes, and seconds, : (colon) may be used to <i>separate< * of using d, ', and &quot; to indicate degrees, minutes, and seconds,
/i> :
* these components (numbers must appear before and after each colon); * (colon) may be used to <i>separate</i> these components (numbers mus
thus t
* 50d30'10.3&quot; may be written as 50:30:10.3, 5.5' may be written * appear before and after each colon); thus 50d30'10.3&quot; may be
* 0:5.5, and so on. The integer parts of the minutes and seconds * written as 50:30:10.3, 5.5' may be written 0:5.5, and so on. The
* components must be less than 60. A single leading sign is permitted * integer parts of the minutes and seconds components must be less tha
. A n
* hemisphere designator (N, E, W, S) may be added to the beginning or * 60. A single leading sign is permitted. A hemisphere designator (N
end , E,
* of the string. The result is multiplied by the implied sign of the * W, S) may be added to the beginning or end of the string. The resul
* hemisphere designator (negative for S and W). In addition \e ind is t is
set * multiplied by the implied sign of the hemisphere designator (negativ
* to DMS::LATITUDE if N or S is present, to DMS::LONGITUDE if E or W i e
s * for S and W). In addition \e ind is set to DMS::LATITUDE if N or S
* present, and to DMS::NONE otherwise. Throws an error on a malformed is
* string. No check is performed on the range of the result. Examples * present, to DMS::LONGITUDE if E or W is present, and to DMS::NONE
of * otherwise. Throws an error on a malformed string. No check is
* legal and illegal strings are * performed on the range of the result. Examples of legal and illegal
* strings are
* - <i>LEGAL</i> (all the entries on each line are equivalent) * - <i>LEGAL</i> (all the entries on each line are equivalent)
* - -20.51125, 20d30'40.5&quot;S, -20&deg;30'40.5, -20d30.675, * - -20.51125, 20d30'40.5&quot;S, -20&deg;30'40.5, -20d30.675,
* N-20d30'40.5&quot;, -20:30:40.5 * N-20d30'40.5&quot;, -20:30:40.5
* - 4d0'9, 4d9&quot;, 4d9'', 4:0:9, 004:00:09, 4.0025, 4.0025d, 4d0. 15, * - 4d0'9, 4d9&quot;, 4d9'', 4:0:9, 004:00:09, 4.0025, 4.0025d, 4d0. 15,
* 04:.15 * 04:.15
* - <i>ILLEGAL</i> (the exception thrown explains the problem) * - <i>ILLEGAL</i> (the exception thrown explains the problem)
* - 4d5&quot;4', 4::5, 4:5:, :4:5, 4d4.5'4&quot;, -N20.5, 1.8e2d, 4: 60, * - 4d5&quot;4', 4::5, 4:5:, :4:5, 4d4.5'4&quot;, -N20.5, 1.8e2d, 4: 60,
* 4d-5' * 4d-5'
* *
* <b>NOTE:</b> At present, all the string handling in the C++ * <b>NOTE:</b> At present, all the string handling in the C++
skipping to change at line 284 skipping to change at line 285
* A hemisphere designator E/W can be used; the result is multiplied by * A hemisphere designator E/W can be used; the result is multiplied by
* &minus;1 if W is present. * &minus;1 if W is present.
********************************************************************** / ********************************************************************** /
static Math::real DecodeAzimuth(const std::string& azistr); static Math::real DecodeAzimuth(const std::string& azistr);
/** /**
* Convert angle (in degrees) into a DMS string (using d, ', and &quot; ). * Convert angle (in degrees) into a DMS string (using d, ', and &quot; ).
* *
* @param[in] angle input angle (degrees) * @param[in] angle input angle (degrees)
* @param[in] trailing DMS::component value indicating the trailing uni ts * @param[in] trailing DMS::component value indicating the trailing uni ts
* on the string and this is given as a decimal number if necessary. * of the string (this component is given as a decimal number if
* necessary).
* @param[in] prec the number of digits after the decimal point for the * @param[in] prec the number of digits after the decimal point for the
* trailing component. * trailing component.
* @param[in] ind DMS::flag value indicated additional formatting. * @param[in] ind DMS::flag value indicated additional formatting.
* @param[in] dmssep if non-null, use as the DMS separator character * @param[in] dmssep if non-null, use as the DMS separator character
* (instead of d, ', &quot; delimiters). * (instead of d, ', &quot; delimiters).
* @exception std::bad_alloc if memory for the string can't be allocate d. * @exception std::bad_alloc if memory for the string can't be allocate d.
* @return formatted string * @return formatted string
* *
* The interpretation of \e ind is as follows: * The interpretation of \e ind is as follows:
* - ind == DMS::NONE, signed result no leading zeros on degrees except in * - ind == DMS::NONE, signed result no leading zeros on degrees except in
 End of changes. 3 change blocks. 
30 lines changed or deleted 32 lines changed or added


 EllipticFunction.hpp   EllipticFunction.hpp 
skipping to change at line 46 skipping to change at line 46
* In geodesic applications, it is convenient to separate the incomplete * In geodesic applications, it is convenient to separate the incomplete
* integrals into secular and periodic components, e.g., * integrals into secular and periodic components, e.g.,
* \f[ * \f[
* E(\phi, k) = (2 E(\phi) / \pi) [ \phi + \delta E(\phi, k) ] * E(\phi, k) = (2 E(\phi) / \pi) [ \phi + \delta E(\phi, k) ]
* \f] * \f]
* where &delta;\e E(&phi;, \e k) is an odd periodic function with period * where &delta;\e E(&phi;, \e k) is an odd periodic function with period
* &pi;. * &pi;.
* *
* The computation of the elliptic integrals uses the algorithms given in * The computation of the elliptic integrals uses the algorithms given in
* - B. C. Carlson, * - B. C. Carlson,
* <a href="http://dx.doi.org/10.1007/BF02198293"> Computation of real or * <a href="https://dx.doi.org/10.1007/BF02198293"> Computation of real or
* complex elliptic integrals</a>, Numerical Algorithms 10, 13--26 (199 5) * complex elliptic integrals</a>, Numerical Algorithms 10, 13--26 (199 5)
* . * .
* with the additional optimizations given in http://dlmf.nist.gov/19.36. i. * with the additional optimizations given in http://dlmf.nist.gov/19.36. i.
* The computation of the Jacobi elliptic functions uses the algorithm gi ven * The computation of the Jacobi elliptic functions uses the algorithm gi ven
* in * in
* - R. Bulirsch, * - R. Bulirsch,
* <a href="http://dx.doi.org/10.1007/BF01397975"> Numerical Calculatio n of * <a href="https://dx.doi.org/10.1007/BF01397975"> Numerical Calculati on of
* Elliptic Integrals and Elliptic Functions</a>, Numericshe Mathematik 7, * Elliptic Integrals and Elliptic Functions</a>, Numericshe Mathematik 7,
* 78--90 (1965). * 78--90 (1965).
* . * .
* The notation follows http://dlmf.nist.gov/19 and http://dlmf.nist.gov/ 22 * The notation follows http://dlmf.nist.gov/19 and http://dlmf.nist.gov/ 22
* *
* Example of use: * Example of use:
* \include example-EllipticFunction.cpp * \include example-EllipticFunction.cpp
**********************************************************************/ **********************************************************************/
class GEOGRAPHICLIB_EXPORT EllipticFunction { class GEOGRAPHICLIB_EXPORT EllipticFunction {
private: private:
skipping to change at line 243 skipping to change at line 243
/** /**
* The complete integral of the third kind. * The complete integral of the third kind.
* *
* @return &Pi;(&alpha;<sup>2</sup>, \e k) * @return &Pi;(&alpha;<sup>2</sup>, \e k)
* *
* &Pi;(&alpha;<sup>2</sup>, \e k) is defined in * &Pi;(&alpha;<sup>2</sup>, \e k) is defined in
* http://dlmf.nist.gov/19.2.E7 * http://dlmf.nist.gov/19.2.E7
* \f[ * \f[
* \Pi(\alpha^2, k) = \int_0^{\pi/2} * \Pi(\alpha^2, k) = \int_0^{\pi/2}
* \frac1{\sqrt{1-k^2\sin^2\phi}(1 - \alpha^2\sin^2\phi_)}\,d\phi. * \frac1{\sqrt{1-k^2\sin^2\phi}(1 - \alpha^2\sin^2\phi)}\,d\phi.
* \f] * \f]
********************************************************************** / ********************************************************************** /
Math::real Pi() const { return _Pic; } Math::real Pi() const { return _Pic; }
/** /**
* Legendre's complete geodesic longitude integral. * Legendre's complete geodesic longitude integral.
* *
* @return \e G(&alpha;<sup>2</sup>, \e k) * @return \e G(&alpha;<sup>2</sup>, \e k)
* *
* \e G(&alpha;<sup>2</sup>, \e k) is given by * \e G(&alpha;<sup>2</sup>, \e k) is given by
skipping to change at line 333 skipping to change at line 333
/** /**
* The incomplete integral of the third kind. * The incomplete integral of the third kind.
* *
* @param[in] phi * @param[in] phi
* @return &Pi;(&phi;, &alpha;<sup>2</sup>, \e k). * @return &Pi;(&phi;, &alpha;<sup>2</sup>, \e k).
* *
* &Pi;(&phi;, &alpha;<sup>2</sup>, \e k) is defined in * &Pi;(&phi;, &alpha;<sup>2</sup>, \e k) is defined in
* http://dlmf.nist.gov/19.2.E7 * http://dlmf.nist.gov/19.2.E7
* \f[ * \f[
* \Pi(\phi, \alpha^2, k) = \int_0^\phi * \Pi(\phi, \alpha^2, k) = \int_0^\phi
* \frac1{\sqrt{1-k^2\sin^2\theta}(1 - \alpha^2\sin^2\theta_)}\,d\t heta. * \frac1{\sqrt{1-k^2\sin^2\theta}(1 - \alpha^2\sin^2\theta)}\,d\th eta.
* \f] * \f]
********************************************************************** / ********************************************************************** /
Math::real Pi(real phi) const; Math::real Pi(real phi) const;
/** /**
* Jahnke's incomplete elliptic integral. * Jahnke's incomplete elliptic integral.
* *
* @param[in] phi * @param[in] phi
* @return \e D(&phi;, \e k). * @return \e D(&phi;, \e k).
* *
skipping to change at line 372 skipping to change at line 372
* \frac{k^2}{\alpha^2} F(\phi, k) + * \frac{k^2}{\alpha^2} F(\phi, k) +
* \biggl(1 - \frac{k^2}{\alpha^2}\biggr) \Pi(\phi, \alpha^2, k) \ \ * \biggl(1 - \frac{k^2}{\alpha^2}\biggr) \Pi(\phi, \alpha^2, k) \ \
* &= \int_0^\phi * &= \int_0^\phi
* \frac{\sqrt{1-k^2\sin^2\theta}}{1 - \alpha^2\sin^2\theta}\,d\the ta. * \frac{\sqrt{1-k^2\sin^2\theta}}{1 - \alpha^2\sin^2\theta}\,d\the ta.
* \end{align} * \end{align}
* \f] * \f]
* *
* Legendre expresses the longitude of a point on the geodesic in terms of * Legendre expresses the longitude of a point on the geodesic in terms of
* this combination of elliptic integrals in Exercices de Calcul * this combination of elliptic integrals in Exercices de Calcul
* Int&eacute;gral, Vol. 1 (1811), p. 181, * Int&eacute;gral, Vol. 1 (1811), p. 181,
* http://books.google.com/books?id=riIOAAAAQAAJ&pg=PA181. * https://books.google.com/books?id=riIOAAAAQAAJ&pg=PA181.
* *
* See \ref geodellip for the expression for the longitude in terms of this * See \ref geodellip for the expression for the longitude in terms of this
* function. * function.
********************************************************************** / ********************************************************************** /
Math::real G(real phi) const; Math::real G(real phi) const;
/** /**
* Cayley's geodesic longitude difference integral. * Cayley's geodesic longitude difference integral.
* *
* @param[in] phi * @param[in] phi
skipping to change at line 399 skipping to change at line 399
* \frac1{\alpha^2} F(\phi, k) + * \frac1{\alpha^2} F(\phi, k) +
* \biggl(1 - \frac1{\alpha^2}\biggr) \Pi(\phi, \alpha^2, k) \\ * \biggl(1 - \frac1{\alpha^2}\biggr) \Pi(\phi, \alpha^2, k) \\
* &= \int_0^\phi * &= \int_0^\phi
* \frac{\cos^2\theta}{(1-\alpha^2\sin^2\theta)\sqrt{1-k^2\sin^2\th eta}} * \frac{\cos^2\theta}{(1-\alpha^2\sin^2\theta)\sqrt{1-k^2\sin^2\th eta}}
* \,d\theta. * \,d\theta.
* \end{align} * \end{align}
* \f] * \f]
* *
* Cayley expresses the longitude difference of a point on the geodesic in * Cayley expresses the longitude difference of a point on the geodesic in
* terms of this combination of elliptic integrals in Phil. Mag. <b>40< /b> * terms of this combination of elliptic integrals in Phil. Mag. <b>40< /b>
* (1870), p. 333, http://books.google.com/books?id=Zk0wAAAAIAAJ&pg=PA3 33. * (1870), p. 333, https://books.google.com/books?id=Zk0wAAAAIAAJ&pg=PA 333.
* *
* See \ref geodellip for the expression for the longitude in terms of this * See \ref geodellip for the expression for the longitude in terms of this
* function. * function.
********************************************************************** / ********************************************************************** /
Math::real H(real phi) const; Math::real H(real phi) const;
///@} ///@}
/** \name Incomplete integrals in terms of Jacobi elliptic functions. /** \name Incomplete integrals in terms of Jacobi elliptic functions.
********************************************************************** / ********************************************************************** /
/** /**
 End of changes. 6 change blocks. 
6 lines changed or deleted 6 lines changed or added


 GeoCoords.hpp   GeoCoords.hpp 
skipping to change at line 74 skipping to change at line 74
} }
static void UTMUPSString(int zone, bool northp, real easting, real nort hing, static void UTMUPSString(int zone, bool northp, real easting, real nort hing,
int prec, bool abbrev, std::string& utm); int prec, bool abbrev, std::string& utm);
void FixHemisphere(); void FixHemisphere();
public: public:
/** \name Initializing the GeoCoords object /** \name Initializing the GeoCoords object
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* The default constructor is equivalent to \e latitude = 90&deg;, * The default constructor sets the coordinate as undefined.
* \e longitude = 0&deg;.
********************************************************************** / ********************************************************************** /
GeoCoords() GeoCoords()
// This is the N pole : _lat(Math::NaN())
: _lat(90) , _long(Math::NaN())
, _long(0) , _easting(Math::NaN())
, _easting(2000000) , _northing(Math::NaN())
, _northing(2000000) , _gamma(Math::NaN())
, _gamma(0) , _k(Math::NaN())
, _k(Constants::UPS_k0()) , _northp(false)
, _northp(true) , _zone(UTMUPS::INVALID)
, _zone(0)
{ CopyToAlt(); } { CopyToAlt(); }
/** /**
* Construct from a string. * Construct from a string.
* *
* @param[in] s 1-element, 2-element, or 3-element string representatio n of * @param[in] s 1-element, 2-element, or 3-element string representatio n of
* the position. * the position.
* @param[in] centerp governs the interpretation of MGRS coordinates (s ee * @param[in] centerp governs the interpretation of MGRS coordinates (s ee
* below). * below).
* @param[in] swaplatlong governs the interpretation of geographic * @param[in] swaplatlong governs the interpretation of geographic
 End of changes. 2 change blocks. 
11 lines changed or deleted 9 lines changed or added


 Geocentric.hpp   Geocentric.hpp 
skipping to change at line 32 skipping to change at line 32
* 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
* coordinates is at the center of the earth. The \e Z axis goes thru th e * coordinates is at the center of the earth. The \e Z axis goes thru th e
* north pole, \e lat = 90&deg;. The \e X axis goes thru \e lat = 0, * north pole, \e lat = 90&deg;. The \e X axis goes thru \e lat = 0,
* \e lon = 0. %Geocentric coordinates are also known as earth centered, * \e lon = 0. %Geocentric coordinates are also known as earth centered,
* earth fixed (ECEF) coordinates. * earth fixed (ECEF) coordinates.
* *
* The conversion from geographic to geocentric coordinates is * The conversion from geographic to geocentric coordinates is
* straightforward. For the reverse transformation we use * straightforward. For the reverse transformation we use
* - H. Vermeille, * - H. Vermeille,
* <a href="http://dx.doi.org/10.1007/s00190-002-0273-6"> Direct * <a href="https://dx.doi.org/10.1007/s00190-002-0273-6"> Direct
* transformation from geocentric coordinates to geodetic coordinates</ a>, * transformation from geocentric coordinates to geodetic coordinates</ a>,
* J. Geodesy 76, 451--454 (2002). * J. Geodesy 76, 451--454 (2002).
* . * .
* Several changes have been made to ensure that the method returns accur ate * Several changes have been made to ensure that the method returns accur ate
* results for all finite inputs (even if \e h is infinite). The changes are * results for all finite inputs (even if \e h is infinite). The changes are
* described in Appendix B of * described in Appendix B of
* - C. F. F. Karney, * - C. F. F. Karney,
* <a href="http://arxiv.org/abs/1102.1215v1">Geodesics * <a href="http://arxiv.org/abs/1102.1215v1">Geodesics
* on an ellipsoid of revolution</a>, * on an ellipsoid of revolution</a>,
* Feb. 2011; * Feb. 2011;
* preprint * preprint
* <a href="http://arxiv.org/abs/1102.1215v1">arxiv:1102.1215v1</a>. * <a href="http://arxiv.org/abs/1102.1215v1">arxiv:1102.1215v1</a>.
* . * .
* Vermeille similarly updated his method in * Vermeille similarly updated his method in
* - H. Vermeille, * - H. Vermeille,
* <a href="http://dx.doi.org/10.1007/s00190-010-0419-x"> * <a href="https://dx.doi.org/10.1007/s00190-010-0419-x">
* An analytical method to transform geocentric into * An analytical method to transform geocentric into
* geodetic coordinates</a>, J. Geodesy 85, 105--117 (2011). * geodetic coordinates</a>, J. Geodesy 85, 105--117 (2011).
* . * .
* See \ref geocentric for more information. * See \ref geocentric for more information.
* *
* The errors in these routines are close to round-off. Specifically, fo r * The errors in these routines are close to round-off. Specifically, fo r
* points within 5000 km of the surface of the ellipsoid (either inside o r * points within 5000 km of the surface of the ellipsoid (either inside o r
* outside the ellipsoid), the error is bounded by 7 nm (7 nanometers) fo r * outside the ellipsoid), the error is bounded by 7 nm (7 nanometers) fo r
* the WGS84 ellipsoid. See \ref geocentric for further information on t he * the WGS84 ellipsoid. See \ref geocentric for further information on t he
* errors. * errors.
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 Geodesic.hpp   Geodesic.hpp 
skipping to change at line 154 skipping to change at line 154
* 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> * </pre>
* For very eccentric ellipsoids, use GeodesicExact instead. * 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="https://dx.doi.org/10.1007/s00190-012-0578-z">
* Algorithms for geodesics</a>, * Algorithms for geodesics</a>,
* J. Geodesy <b>87</b>, 43--55 (2013); * J. Geodesy <b>87</b>, 43--55 (2013);
* DOI: <a href="http://dx.doi.org/10.1007/s00190-012-0578-z"> * DOI: <a href="https://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
* *
* <a href="GeodSolve.1.html">GeodSolve</a> is a command-line utility * <a href="GeodSolve.1.html">GeodSolve</a> is a command-line utility
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 GeodesicLine.hpp   GeodesicLine.hpp 
skipping to change at line 42 skipping to change at line 42
* 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 are only accura te * using the flattening \e f as a small parameter. These are only accura te
* for |<i>f</i>| &lt; 0.02; however reasonably accurate results will be * for |<i>f</i>| &lt; 0.02; however reasonably accurate results will be
* obtained for |<i>f</i>| &lt; 0.2. For very eccentric ellipsoids, use * obtained for |<i>f</i>| &lt; 0.2. For very eccentric ellipsoids, use
* GeodesicLineExact instead. * GeodesicLineExact 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="https://dx.doi.org/10.1007/s00190-012-0578-z">
* Algorithms for geodesics</a>, * Algorithms for geodesics</a>,
* J. Geodesy <b>87</b>, 43--55 (2013); * J. Geodesy <b>87</b>, 43--55 (2013);
* DOI: <a href="http://dx.doi.org/10.1007/s00190-012-0578-z"> * DOI: <a href="https://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
* *
* <a href="GeodSolve.1.html">GeodSolve</a> is a command-line utility * <a href="GeodSolve.1.html">GeodSolve</a> is a command-line utility
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 Geohash.hpp   Geohash.hpp 
skipping to change at line 28 skipping to change at line 28
# pragma warning (disable: 4251) # pragma warning (disable: 4251)
#endif #endif
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief Conversions for geohashes * \brief Conversions for geohashes
* *
* Geohashes are described in * Geohashes are described in
* - https://en.wikipedia.org/wiki/Geohash * - https://en.wikipedia.org/wiki/Geohash
* - http://geohash.org/ * - http://geohash.org/ (this link is broken as of 2012-12-11)
* . * .
* They provide a compact string representation of a particular geographi c * They provide a compact string representation of a particular geographi c
* location (expressed as latitude and longitude), with the property that if * location (expressed as latitude and longitude), with the property that if
* trailing characters are dropped from the string the geographic locatio n * trailing characters are dropped from the string the geographic locatio n
* remains nearby. * remains nearby.
* *
* Example of use: * Example of use:
* \include example-Geohash.cpp * \include example-Geohash.cpp
**********************************************************************/ **********************************************************************/
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 Gnomonic.hpp   Gnomonic.hpp 
skipping to change at line 25 skipping to change at line 25
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
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="https://dx.doi.org/10.1007/s00190-012-0578-z">
* Algorithms for geodesics</a>, * Algorithms for geodesics</a>,
* J. Geodesy <b>87</b>, 43--55 (2013); * J. Geodesy <b>87</b>, 43--55 (2013);
* DOI: <a href="http://dx.doi.org/10.1007/s00190-012-0578-z"> * DOI: <a href="https://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
* azimuth \e azi of the geodesic at \e P and reciprocal scale \e rk in t he * azimuth \e azi of the geodesic at \e P and reciprocal scale \e rk in t he
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 LambertConformalConic.hpp   LambertConformalConic.hpp 
skipping to change at line 78 skipping to change at line 78
inline real eatanhe(real x) const { inline real eatanhe(real x) const {
using std::atan; using std::atan;
return _f >= 0 ? _e * Math::atanh(_e * x) : - _e * atan(_e * x); return _f >= 0 ? _e * Math::atanh(_e * x) : - _e * atan(_e * x);
} }
// Divided differences // Divided differences
// Definition: Df(x,y) = (f(x)-f(y))/(x-y) // Definition: Df(x,y) = (f(x)-f(y))/(x-y)
// See: // See:
// W. M. Kahan and R. J. Fateman, // W. M. Kahan and R. J. Fateman,
// Symbolic computation of divided differences, // Symbolic computation of divided differences,
// SIGSAM Bull. 33(3), 7-28 (1999) // SIGSAM Bull. 33(3), 7-28 (1999)
// http://dx.doi.org/10.1145/334714.334716 // https://dx.doi.org/10.1145/334714.334716
// http://www.cs.berkeley.edu/~fateman/papers/divdiff.pdf // http://www.cs.berkeley.edu/~fateman/papers/divdiff.pdf
// //
// General rules // General rules
// h(x) = f(g(x)): Dh(x,y) = Df(g(x),g(y))*Dg(x,y) // h(x) = f(g(x)): Dh(x,y) = Df(g(x),g(y))*Dg(x,y)
// h(x) = f(x)*g(x): // h(x) = f(x)*g(x):
// Dh(x,y) = Df(x,y)*g(x) + Dg(x,y)*f(y) // Dh(x,y) = Df(x,y)*g(x) + Dg(x,y)*f(y)
// = Df(x,y)*g(y) + Dg(x,y)*f(x) // = Df(x,y)*g(y) + Dg(x,y)*f(x)
// = Df(x,y)*(g(x)+g(y))/2 + Dg(x,y)*(f(x)+f(y))/2 // = Df(x,y)*(g(x)+g(y))/2 + Dg(x,y)*(f(x)+f(y))/2
// //
// hyp(x) = sqrt(1+x^2): Dhyp(x,y) = (x+y)/(hyp(x)+hyp(y)) // hyp(x) = sqrt(1+x^2): Dhyp(x,y) = (x+y)/(hyp(x)+hyp(y))
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 MGRS.hpp   MGRS.hpp 
skipping to change at line 238 skipping to change at line 238
* the zone number followed by one of [C--M] for the southern * the zone number followed by one of [C--M] for the southern
* hemisphere and [N--X] for the northern hemisphere. For \e zone = * hemisphere and [N--X] for the northern hemisphere. For \e zone =
* 0, the MGRS coordinates begins with one of [AB] for the southern * 0, the MGRS coordinates begins with one of [AB] for the southern
* hemisphere and [XY] for the northern hemisphere. * hemisphere and [XY] for the northern hemisphere.
* *
* The conversion to the MGRS is exact for prec in [0, 5] except that a * The conversion to the MGRS is exact for prec in [0, 5] except that a
* neighboring latitude band letter may be given if the point is within 5nm * neighboring latitude band letter may be given if the point is within 5nm
* of a band boundary. For prec in [6, 11], the conversion is accurate to * of a band boundary. For prec in [6, 11], the conversion is accurate to
* roundoff. * roundoff.
* *
* If \e prec = -1, then the "grid zone designation", e.g., 18T, is * If \e prec = &minus;1, then the "grid zone designation", e.g., 18T, is
* returned. This consists of the UTM zone number (absent for UPS) and the * returned. This consists of the UTM zone number (absent for UPS) and the
* first letter of the MGRS string which labels the latitude band for U TM * first letter of the MGRS string which labels the latitude band for U TM
* and the hemisphere for UPS. * and the hemisphere for UPS.
* *
* If \e x or \e y is NaN or if \e zone is UTMUPS::INVALID, the returne d * If \e x or \e y is NaN or if \e zone is UTMUPS::INVALID, the returne d
* MGRS string is "INVALID". * MGRS string is "INVALID".
* *
* Return the result via a reference argument to avoid the overhead of * Return the result via a reference argument to avoid the overhead of
* allocating a potentially large number of small strings. If an error is * allocating a potentially large number of small strings. If an error is
* thrown, then \e mgrs is unchanged. * thrown, then \e mgrs is unchanged.
skipping to change at line 314 skipping to change at line 314
* *
* The UTM/UPS selection and the UTM zone is preserved in the conversio n * The UTM/UPS selection and the UTM zone is preserved in the conversio n
* from MGRS coordinate. The conversion is exact for prec in [0, 5]. With * from MGRS coordinate. The conversion is exact for prec in [0, 5]. With
* centerp = true the conversion from MGRS to geographic and back is * centerp = true the conversion from MGRS to geographic and back is
* stable. This is not assured if \e centerp = false. * stable. This is not assured if \e centerp = false.
* *
* If a "grid zone designation" (for example, 18T or A) is given, then some * If a "grid zone designation" (for example, 18T or A) is given, then some
* suitable (but essentially arbitrary) point within that grid zone is * suitable (but essentially arbitrary) point within that grid zone is
* returned. The main utility of the conversion is to allow \e zone an d \e * returned. The main utility of the conversion is to allow \e zone an d \e
* northp to be determined. In this case, the \e centerp parameter is * northp to be determined. In this case, the \e centerp parameter is
* ignored. * ignored and \e prec is set to &minus;1.
* *
* If the first 3 characters of \e mgrs are "INV", then \e x and \e y a re * If the first 3 characters of \e mgrs are "INV", then \e x and \e y a re
* set to NaN and \e zone is set to UTMUPS::INVALID. * set to NaN, \e zone is set to UTMUPS::INVALID, and \e prec is set to
* &minus;2.
* *
* If an exception is thrown, then the arguments are unchanged. * If an exception is thrown, then the arguments are unchanged.
********************************************************************** / ********************************************************************** /
static void Reverse(const std::string& mgrs, static void Reverse(const std::string& mgrs,
int& zone, bool& northp, real& x, real& y, int& zone, bool& northp, real& x, real& y,
int& prec, bool centerp = true); int& prec, bool centerp = true);
/** \name Inspector functions /** \name Inspector functions
********************************************************************** / ********************************************************************** /
///@{ ///@{
 End of changes. 3 change blocks. 
3 lines changed or deleted 4 lines changed or added


 MagneticModel.hpp   MagneticModel.hpp 
skipping to change at line 45 skipping to change at line 45
* *
* See \ref magnetic for details of how to install the magnetic model and the * See \ref magnetic for details of how to install the magnetic model and the
* data format. * data format.
* *
* See * See
* - General information: * - General information:
* - http://geomag.org/models/index.html * - http://geomag.org/models/index.html
* - WMM2010: * - WMM2010:
* - http://ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml * - http://ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml
* - http://ngdc.noaa.gov/geomag/WMM/data/WMM2010/WMM2010COF.zip * - http://ngdc.noaa.gov/geomag/WMM/data/WMM2010/WMM2010COF.zip
* - WMM2015:
* - http://ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml
* - http://ngdc.noaa.gov/geomag/WMM/data/WMM2015/WMM2015COF.zip
* - IGRF11: * - IGRF11:
* - http://ngdc.noaa.gov/IAGA/vmod/igrf.html * - http://ngdc.noaa.gov/IAGA/vmod/igrf.html
* - http://ngdc.noaa.gov/IAGA/vmod/igrf11coeffs.txt * - http://ngdc.noaa.gov/IAGA/vmod/igrf11coeffs.txt
* - http://ngdc.noaa.gov/IAGA/vmod/geomag70_linux.tar.gz * - http://ngdc.noaa.gov/IAGA/vmod/geomag70_linux.tar.gz
* - EMM2010: * - EMM2010:
* - http://ngdc.noaa.gov/geomag/EMM/index.html * - http://ngdc.noaa.gov/geomag/EMM/index.html
* - http://ngdc.noaa.gov/geomag/EMM/data/geomag/EMM2010_Sph_Windows_Li nux.zip * - http://ngdc.noaa.gov/geomag/EMM/data/geomag/EMM2010_Sph_Windows_Li nux.zip
* *
* Example of use: * Example of use:
* \include example-MagneticModel.cpp * \include example-MagneticModel.cpp
skipping to change at line 330 skipping to change at line 333
* GEOGRAPHICLIB_DATA is set; otherwise, it is a compile-time default * GEOGRAPHICLIB_DATA is set; otherwise, it is a compile-time default
* (/usr/local/share/GeographicLib/magnetic on non-Windows systems and * (/usr/local/share/GeographicLib/magnetic on non-Windows systems and
* C:/ProgramData/GeographicLib/magnetic on Windows systems). * C:/ProgramData/GeographicLib/magnetic on Windows systems).
********************************************************************** / ********************************************************************** /
static std::string DefaultMagneticPath(); static std::string DefaultMagneticPath();
/** /**
* @return the default name for the magnetic model. * @return the default name for the magnetic model.
* *
* This is the value of the environment variable * This is the value of the environment variable
* GEOGRAPHICLIB_MAGNETIC_NAME, if set; otherwise, it is "wmm2010". Th e * GEOGRAPHICLIB_MAGNETIC_NAME, if set; otherwise, it is "wmm2015". Th e
* MagneticModel class does not use this function; it is just provided as a * MagneticModel class does not use this function; it is just provided as a
* convenience for a calling program when constructing a MagneticModel * convenience for a calling program when constructing a MagneticModel
* object. * object.
********************************************************************** / ********************************************************************** /
static std::string DefaultMagneticName(); static std::string DefaultMagneticName();
}; };
} // namespace GeographicLib } // namespace GeographicLib
#if defined(_MSC_VER) #if defined(_MSC_VER)
 End of changes. 2 change blocks. 
1 lines changed or deleted 4 lines changed or added


 Math.hpp   Math.hpp 
skipping to change at line 25 skipping to change at line 25
#define GEOGRAPHICLIB_MATH_HPP 1 #define GEOGRAPHICLIB_MATH_HPP 1
/** /**
* Are C++11 math functions available? * Are C++11 math functions available?
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_CXX11_MATH) #if !defined(GEOGRAPHICLIB_CXX11_MATH)
// Recent versions of g++ -std=c++11 (4.7 and later?) set __cplusplus to 20 1103 // Recent versions of g++ -std=c++11 (4.7 and later?) set __cplusplus to 20 1103
// and support the new C++11 mathematical functions, std::atanh, etc. Howe ver // and support the new C++11 mathematical functions, std::atanh, etc. Howe ver
// the Android toolchain, which uses g++ -std=c++11 (4.8 as of 2014-03-11, // the Android toolchain, which uses g++ -std=c++11 (4.8 as of 2014-03-11,
// according to Pullan Lu), does not support std::atanh. Android toolchain s // according to Pullan Lu), does not support std::atanh. Android toolchain s
// might define __ANDROID__ or ANDROID; so need to check both. // might define __ANDROID__ or ANDROID; so need to check both. With OSX th
# if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ >= 7 \ e
&& __cplusplus >= 201103 && \ // version is GNUC version 4.2 and __cplusplus is set to 201103, so remove
the
// version check on GNUC.
# if defined(__GNUC__) && __cplusplus >= 201103 && \
!(defined(__ANDROID__) || defined(ANDROID) || defined(__CYGWIN__)) !(defined(__ANDROID__) || defined(ANDROID) || defined(__CYGWIN__))
# define GEOGRAPHICLIB_CXX11_MATH 1 # define GEOGRAPHICLIB_CXX11_MATH 1
// Visual C++ 12 supports these functions // Visual C++ 12 supports these functions
# elif defined(_MSC_VER) && _MSC_VER >= 1800 # elif defined(_MSC_VER) && _MSC_VER >= 1800
# define GEOGRAPHICLIB_CXX11_MATH 1 # define GEOGRAPHICLIB_CXX11_MATH 1
# else # else
# define GEOGRAPHICLIB_CXX11_MATH 0 # define GEOGRAPHICLIB_CXX11_MATH 0
# endif # endif
#endif #endif
skipping to change at line 264 skipping to change at line 265
template<typename T> static inline T hypot(T x, T y) { template<typename T> static inline T hypot(T x, T y) {
#if GEOGRAPHICLIB_CXX11_MATH #if GEOGRAPHICLIB_CXX11_MATH
using std::hypot; return hypot(x, y); using std::hypot; return hypot(x, y);
#else #else
using std::abs; using std::sqrt; using std::abs; using std::sqrt;
x = abs(x); y = abs(y); x = abs(x); y = abs(y);
if (x < y) std::swap(x, y); // Now x >= y >= 0 if (x < y) std::swap(x, y); // Now x >= y >= 0
y /= (x ? x : 1); y /= (x ? x : 1);
return x * sqrt(1 + y * y); return x * sqrt(1 + y * y);
// For an alternative (square-root free) method see // For an alternative (square-root free) method see
// C. Moler and D. Morrision (1983) http://dx.doi.org/10.1147/rd.276. // C. Moler and D. Morrision (1983) https://dx.doi.org/10.1147/rd.276
0577 .0577
// and A. A. Dubrulle (1983) http://dx.doi.org/10.1147/rd.276.0582 // and A. A. Dubrulle (1983) https://dx.doi.org/10.1147/rd.276.0582
#endif #endif
} }
/** /**
* exp(\e x) &minus; 1 accurate near \e x = 0. * exp(\e x) &minus; 1 accurate near \e x = 0.
* *
* @tparam T the type of the argument and the returned value. * @tparam T the type of the argument and the returned value.
* @param[in] x * @param[in] x
* @return exp(\e x) &minus; 1. * @return exp(\e x) &minus; 1.
********************************************************************** / ********************************************************************** /
template<typename T> static inline T expm1(T x) { template<typename T> static inline T expm1(T x) {
#if GEOGRAPHICLIB_CXX11_MATH #if GEOGRAPHICLIB_CXX11_MATH
using std::expm1; return expm1(x); using std::expm1; return expm1(x);
#else #else
using std::exp; using std::abs; using std::log; using std::exp; using std::abs; using std::log;
volatile T GEOGRAPHICLIB_VOLATILE T
y = exp(x), y = exp(x),
z = y - 1; z = y - 1;
// The reasoning here is similar to that for log1p. The expression // The reasoning here is similar to that for log1p. The expression
// mathematically reduces to exp(x) - 1, and the factor z/log(y) = (y - // mathematically reduces to exp(x) - 1, and the factor z/log(y) = (y -
// 1)/log(y) is a slowly varying quantity near y = 1 and is accuratel y // 1)/log(y) is a slowly varying quantity near y = 1 and is accuratel y
// computed. // computed.
return abs(x) > 1 ? z : (z == 0 ? x : x * z / log(y)); return abs(x) > 1 ? z : (z == 0 ? x : x * z / log(y));
#endif #endif
} }
skipping to change at line 304 skipping to change at line 305
* *
* @tparam T the type of the argument and the returned value. * @tparam T the type of the argument and the returned value.
* @param[in] x * @param[in] x
* @return log(1 + \e x). * @return log(1 + \e x).
********************************************************************** / ********************************************************************** /
template<typename T> static inline T log1p(T x) { template<typename T> static inline T log1p(T x) {
#if GEOGRAPHICLIB_CXX11_MATH #if GEOGRAPHICLIB_CXX11_MATH
using std::log1p; return log1p(x); using std::log1p; return log1p(x);
#else #else
using std::log; using std::log;
volatile T GEOGRAPHICLIB_VOLATILE T
y = 1 + x, y = 1 + x,
z = y - 1; z = y - 1;
// Here's the explanation for this magic: y = 1 + z, exactly, and z // Here's the explanation for this magic: y = 1 + z, exactly, and z
// approx x, thus log(y)/z (which is nearly constant near z = 0) retu rns // approx x, thus log(y)/z (which is nearly constant near z = 0) retu rns
// a good approximation to the true log(1 + x)/x. The multiplication x * // a good approximation to the true log(1 + x)/x. The multiplication x *
// (log(y)/z) introduces little additional error. // (log(y)/z) introduces little additional error.
return z == 0 ? x : x * log(y) / z; return z == 0 ? x : x * log(y) / z;
#endif #endif
} }
 End of changes. 4 change blocks. 
8 lines changed or deleted 11 lines changed or added


 NormalGravity.hpp   NormalGravity.hpp 
skipping to change at line 54 skipping to change at line 54
* - <b>&gamma;</b> = &nabla;\e U = <b>&Gamma;</b> + <b>f</b>, the normal * - <b>&gamma;</b> = &nabla;\e U = <b>&Gamma;</b> + <b>f</b>, the normal
* acceleration; * acceleration;
* - \e X, \e Y, \e Z, geocentric coordinates; * - \e X, \e Y, \e Z, geocentric coordinates;
* - \e x, \e y, \e z, local cartesian coordinates used to denote the eas t, * - \e x, \e y, \e z, local cartesian coordinates used to denote the eas t,
* north and up directions. * north and up directions.
* *
* References: * References:
* - W. A. Heiskanen and H. Moritz, Physical Geodesy (Freeman, San * - W. A. Heiskanen and H. Moritz, Physical Geodesy (Freeman, San
* Francisco, 1967), Secs. 1-19, 2-7, 2-8 (2-9, 2-10), 6-2 (6-3). * Francisco, 1967), Secs. 1-19, 2-7, 2-8 (2-9, 2-10), 6-2 (6-3).
* - H. Moritz, Geodetic Reference System 1980, J. Geodesy 54(3), 395-405 * - H. Moritz, Geodetic Reference System 1980, J. Geodesy 54(3), 395-405
* (1980) http://dx.doi.org/10.1007/BF02521480 * (1980) https://dx.doi.org/10.1007/BF02521480
* *
* Example of use: * Example of use:
* \include example-NormalGravity.cpp * \include example-NormalGravity.cpp
**********************************************************************/ **********************************************************************/
class GEOGRAPHICLIB_EXPORT NormalGravity { class GEOGRAPHICLIB_EXPORT NormalGravity {
private: private:
static const int maxit_ = 10; static const int maxit_ = 10;
typedef Math::real real; typedef Math::real real;
friend class GravityModel; friend class GravityModel;
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 OSGB.hpp   OSGB.hpp 
/** /**
* \file OSGB.hpp * \file OSGB.hpp
* \brief Header for GeographicLib::OSGB class * \brief Header for GeographicLib::OSGB class
* *
* Copyright (c) Charles Karney (2010-2013) <charles@karney.com> and licens ed * Copyright (c) Charles Karney (2010-2014) <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 <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/TransverseMercator.hpp> #include <GeographicLib/TransverseMercator.hpp>
skipping to change at line 50 skipping to change at line 50
* *
* Example of use: * Example of use:
* \include example-OSGB.cpp * \include example-OSGB.cpp
**********************************************************************/ **********************************************************************/
class GEOGRAPHICLIB_EXPORT OSGB { class GEOGRAPHICLIB_EXPORT OSGB {
private: private:
typedef Math::real real; typedef Math::real real;
static const std::string letters_; static const std::string letters_;
static const std::string digits_; static const std::string digits_;
static const TransverseMercator& OSGBTM(); static const TransverseMercator& OSGBTM();
static real northoffset_;
static bool init_;
enum { enum {
base_ = 10, base_ = 10,
tile_ = 100000, tile_ = 100000,
tilelevel_ = 5, tilelevel_ = 5,
tilegrid_ = 5, tilegrid_ = 5,
tileoffx_ = 2 * tilegrid_, tileoffx_ = 2 * tilegrid_,
tileoffy_ = 1 * tilegrid_, tileoffy_ = 1 * tilegrid_,
minx_ = - tileoffx_ * tile_, minx_ = - tileoffx_ * tile_,
miny_ = - tileoffy_ * tile_, miny_ = - tileoffy_ * tile_,
maxx_ = (tilegrid_*tilegrid_ - tileoffx_) * tile_, maxx_ = (tilegrid_*tilegrid_ - tileoffx_) * tile_,
skipping to change at line 154 skipping to change at line 152
* - prec = 3, 100m * - prec = 3, 100m
* - prec = 4, 10m * - prec = 4, 10m
* - prec = 5, 1m * - prec = 5, 1m
* - prec = 6, 0.1m * - prec = 6, 0.1m
* - prec = 11 (max), 1&mu;m * - prec = 11 (max), 1&mu;m
* *
* The easting must be in the range [&minus;1000 km, 1500 km) and the * The easting must be in the range [&minus;1000 km, 1500 km) and the
* northing must be in the range [&minus;500 km, 2000 km). These bound s * northing must be in the range [&minus;500 km, 2000 km). These bound s
* are consistent with rules for the letter designations for the grid * are consistent with rules for the letter designations for the grid
* system. * system.
*
* If \e x or \e y is NaN, the returned grid reference is "INVALID".
********************************************************************** / ********************************************************************** /
static void GridReference(real x, real y, int prec, std::string& gridre f); static void GridReference(real x, real y, int prec, std::string& gridre f);
/** /**
* Convert OSGB coordinates to a grid reference. * Convert OSGB coordinates to a grid reference.
* *
* @param[in] gridref National Grid reference. * @param[in] gridref National Grid reference.
* @param[out] x easting of point (meters). * @param[out] x easting of point (meters).
* @param[out] y northing of point (meters). * @param[out] y northing of point (meters).
* @param[out] prec precision relative to 100 km. * @param[out] prec precision relative to 100 km.
* @param[in] centerp if true (default), return center of the grid squa re, * @param[in] centerp if true (default), return center of the grid squa re,
* else return SW (lower left) corner. * else return SW (lower left) corner.
* @exception GeographicErr if \e gridref is illegal. * @exception GeographicErr if \e gridref is illegal.
* *
* The grid reference must be of the form: two letters (not including I ) * The grid reference must be of the form: two letters (not including I )
* followed by an even number of digits (up to 22). * followed by an even number of digits (up to 22).
*
* If the first 2 characters of \e gridref are "IN", then \e x and \e y
are
* set to NaN and \e prec is set to &minus;2.
********************************************************************** / ********************************************************************** /
static void GridReference(const std::string& gridref, static void GridReference(const std::string& gridref,
real& x, real& y, int& prec, real& x, real& y, int& prec,
bool centerp = true); bool centerp = true);
/** \name Inspector functions /** \name Inspector functions
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* @return \e a the equatorial radius of the Airy 1830 ellipsoid (meter s). * @return \e a the equatorial radius of the Airy 1830 ellipsoid (meter s).
 End of changes. 4 change blocks. 
3 lines changed or deleted 7 lines changed or added


 PolygonArea.hpp   PolygonArea.hpp 
skipping to change at line 26 skipping to change at line 26
#include <GeographicLib/Accumulator.hpp> #include <GeographicLib/Accumulator.hpp>
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief Polygon areas * \brief Polygon areas
* *
* This computes the area of a polygon whose edges are geodesics using th e * This computes the area of a polygon whose edges are geodesics using th e
* method given in Section 6 of * method given in 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="https://dx.doi.org/10.1007/s00190-012-0578-z">
* Algorithms for geodesics</a>, * Algorithms for geodesics</a>,
* J. Geodesy <b>87</b>, 43--55 (2013); * J. Geodesy <b>87</b>, 43--55 (2013);
* DOI: <a href="http://dx.doi.org/10.1007/s00190-012-0578-z"> * DOI: <a href="https://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 and edges one at a time to the polygo n. * This class lets you add vertices and edges one at a time to the polygo n.
* The sequence must start with a vertex and thereafter vertices and edge s * The sequence must start with a vertex and thereafter vertices and edge s
* can be added in any order. Any vertex after the first creates a new e dge * can be added in any order. Any vertex after the first creates a new e dge
* which is the ''shortest'' geodesic from the previous vertex. In some * which is the ''shortest'' geodesic from the previous vertex. In some
* cases there may be two or many such shortest geodesics and the area is * cases there may be two or many such shortest geodesics and the area is
* then not uniquely defined. In this case, either add an intermediate * then not uniquely defined. In this case, either add an intermediate
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 Rhumb.hpp   Rhumb.hpp 
skipping to change at line 101 skipping to change at line 101
{ using std::atan; using std::sinh; return atan(sinh(x)); } { using std::atan; using std::sinh; return atan(sinh(x)); }
// Use divided differences to determine (mu2 - mu1) / (psi2 - psi1) // Use divided differences to determine (mu2 - mu1) / (psi2 - psi1)
// accurately // accurately
// //
// Definition: Df(x,y,d) = (f(x) - f(y)) / (x - y) // Definition: Df(x,y,d) = (f(x) - f(y)) / (x - y)
// See: // See:
// W. M. Kahan and R. J. Fateman, // W. M. Kahan and R. J. Fateman,
// Symbolic computation of divided differences, // Symbolic computation of divided differences,
// SIGSAM Bull. 33(3), 7-28 (1999) // SIGSAM Bull. 33(3), 7-28 (1999)
// http://dx.doi.org/10.1145/334714.334716 // https://dx.doi.org/10.1145/334714.334716
// http://www.cs.berkeley.edu/~fateman/papers/divdiff.pdf // http://www.cs.berkeley.edu/~fateman/papers/divdiff.pdf
static inline real Dlog(real x, real y) { static inline real Dlog(real x, real y) {
real t = x - y; real t = x - y;
return t ? 2 * Math::atanh(t / (x + y)) / t : 1 / x; return t ? 2 * Math::atanh(t / (x + y)) / t : 1 / x;
} }
static inline real Dtan(real x, real y) { static inline real Dtan(real x, real y) {
real d = x - y, tx = tano(x), ty = tano(y), txy = tx * ty; real d = x - y, tx = tano(x), ty = tano(y), txy = tx * ty;
return d ? (2 * txy > -1 ? (1 + txy) * tano(d) : tx - ty) / d : return d ? (2 * txy > -1 ? (1 + txy) * tano(d) : tx - ty) / d :
1 + txy; 1 + txy;
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 TransverseMercator.hpp   TransverseMercator.hpp 
skipping to change at line 33 skipping to change at line 33
#endif #endif
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief Transverse Mercator projection * \brief Transverse Mercator projection
* *
* This uses Kr&uuml;ger's method which evaluates the projection and its * This uses Kr&uuml;ger's method which evaluates the projection and its
* inverse in terms of a series. See * inverse in terms of a series. See
* - L. Kr&uuml;ger, * - L. Kr&uuml;ger,
* <a href="http://dx.doi.org/10.2312/GFZ.b103-krueger28"> Konforme * <a href="https://dx.doi.org/10.2312/GFZ.b103-krueger28"> Konforme
* Abbildung des Erdellipsoids in der Ebene</a> (Conformal mapping of the * Abbildung des Erdellipsoids in der Ebene</a> (Conformal mapping of the
* ellipsoidal earth to the plane), Royal Prussian Geodetic Institute, New * ellipsoidal earth to the plane), Royal Prussian Geodetic Institute, New
* Series 52, 172 pp. (1912). * Series 52, 172 pp. (1912).
* - C. F. F. Karney, * - C. F. F. Karney,
* <a href="http://dx.doi.org/10.1007/s00190-011-0445-3"> * <a href="https://dx.doi.org/10.1007/s00190-011-0445-3">
* Transverse Mercator with an accuracy of a few nanometers,</a> * Transverse Mercator with an accuracy of a few nanometers,</a>
* J. Geodesy 85(8), 475--485 (Aug. 2011); * J. Geodesy 85(8), 475--485 (Aug. 2011);
* preprint * preprint
* <a href="http://arxiv.org/abs/1002.1417">arXiv:1002.1417</a>. * <a href="http://arxiv.org/abs/1002.1417">arXiv:1002.1417</a>.
* *
* Kr&uuml;ger's method has been extended from 4th to 6th order. The max imum * Kr&uuml;ger's method has been extended from 4th to 6th order. The max imum
* error is 5 nm (5 nanometers), ground distance, for all positions withi n 35 * error is 5 nm (5 nanometers), ground distance, for all positions withi n 35
* degrees of the central meridian. The error in the convergence is 2 * degrees of the central meridian. The error in the convergence is 2
* &times; 10<sup>&minus;15</sup>&quot; and the relative error in the sca le * &times; 10<sup>&minus;15</sup>&quot; and the relative error in the sca le
* is 6 &minus; 10<sup>&minus;12</sup>%%. See Sec. 4 of * is 6 &minus; 10<sup>&minus;12</sup>%%. See Sec. 4 of
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 TransverseMercatorExact.hpp   TransverseMercatorExact.hpp 
skipping to change at line 23 skipping to change at line 23
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/EllipticFunction.hpp> #include <GeographicLib/EllipticFunction.hpp>
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief An exact implementation of the transverse Mercator projection * \brief An exact implementation of the transverse Mercator projection
* *
* Implementation of the Transverse Mercator Projection given in * Implementation of the Transverse Mercator Projection given in
* - L. P. Lee, * - L. P. Lee,
* <a href="http://dx.doi.org/10.3138/X687-1574-4325-WM62"> Conformal * <a href="https://dx.doi.org/10.3138/X687-1574-4325-WM62"> Conformal
* Projections Based On Jacobian Elliptic Functions</a>, Part V of * Projections Based On Jacobian Elliptic Functions</a>, Part V of
* Conformal Projections Based on Elliptic Functions, * Conformal Projections Based on Elliptic Functions,
* (B. V. Gutsell, Toronto, 1976), 128pp., * (B. V. Gutsell, Toronto, 1976), 128pp.,
* ISBN: 0919870163 * ISBN: 0919870163
* (also appeared as: * (also appeared as:
* Monograph 16, Suppl. No. 1 to Canadian Cartographer, Vol 13). * Monograph 16, Suppl. No. 1 to Canadian Cartographer, Vol 13).
* - C. F. F. Karney, * - C. F. F. Karney,
* <a href="http://dx.doi.org/10.1007/s00190-011-0445-3"> * <a href="https://dx.doi.org/10.1007/s00190-011-0445-3">
* Transverse Mercator with an accuracy of a few nanometers,</a> * Transverse Mercator with an accuracy of a few nanometers,</a>
* J. Geodesy 85(8), 475--485 (Aug. 2011); * J. Geodesy 85(8), 475--485 (Aug. 2011);
* preprint * preprint
* <a href="http://arxiv.org/abs/1002.1417">arXiv:1002.1417</a>. * <a href="http://arxiv.org/abs/1002.1417">arXiv:1002.1417</a>.
* *
* Lee gives the correct results for forward and reverse transformations * Lee gives the correct results for forward and reverse transformations
* subject to the branch cut rules (see the description of the \e extendp * subject to the branch cut rules (see the description of the \e extendp
* argument to the constructor). The maximum error is about 8 nm (8 * argument to the constructor). The maximum error is about 8 nm (8
* nanometers), ground distance, for the forward and reverse transformati ons. * nanometers), ground distance, for the forward and reverse transformati ons.
* The error in the convergence is 2 &times; 10<sup>&minus;15</sup>&quot; , * The error in the convergence is 2 &times; 10<sup>&minus;15</sup>&quot; ,
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 Utility.hpp   Utility.hpp 
skipping to change at line 465 skipping to change at line 465
* @tparam IntT the type of the objects in the array (internal). * @tparam IntT the type of the objects in the array (internal).
* @tparam bigendp true if the external storage format is big-endian. * @tparam bigendp true if the external storage format is big-endian.
* @param[in] str the input stream containing the data of type ExtT * @param[in] str the input stream containing the data of type ExtT
* (external). * (external).
* @param[out] array the output vector of type IntT (internal). * @param[out] array the output vector of type IntT (internal).
* @exception GeographicErr if the data cannot be read. * @exception GeographicErr if the data cannot be read.
********************************************************************** / ********************************************************************** /
template<typename ExtT, typename IntT, bool bigendp> template<typename ExtT, typename IntT, bool bigendp>
static inline void readarray(std::istream& str, static inline void readarray(std::istream& str,
std::vector<IntT>& array) { std::vector<IntT>& array) {
readarray<ExtT, IntT, bigendp>(str, &array[0], array.size()); if (array.size() > 0)
readarray<ExtT, IntT, bigendp>(str, &array[0], array.size());
} }
/** /**
* Write data in an array of type IntT as type ExtT to a binary stream. * Write data in an array of type IntT as type ExtT to a binary stream.
* The data in the file is in (bigendp ? big : little)-endian format. * The data in the file is in (bigendp ? big : little)-endian format.
* *
* @tparam ExtT the type of the objects in the binary stream (external) . * @tparam ExtT the type of the objects in the binary stream (external) .
* @tparam IntT the type of the objects in the array (internal). * @tparam IntT the type of the objects in the array (internal).
* @tparam bigendp true if the external storage format is big-endian. * @tparam bigendp true if the external storage format is big-endian.
* @param[out] str the output stream for the data of type ExtT (externa l). * @param[out] str the output stream for the data of type ExtT (externa l).
skipping to change at line 530 skipping to change at line 531
* @tparam ExtT the type of the objects in the binary stream (external) . * @tparam ExtT the type of the objects in the binary stream (external) .
* @tparam IntT the type of the objects in the array (internal). * @tparam IntT the type of the objects in the array (internal).
* @tparam bigendp true if the external storage format is big-endian. * @tparam bigendp true if the external storage format is big-endian.
* @param[out] str the output stream for the data of type ExtT (externa l). * @param[out] str the output stream for the data of type ExtT (externa l).
* @param[in] array the input vector of type IntT (internal). * @param[in] array the input vector of type IntT (internal).
* @exception GeographicErr if the data cannot be written. * @exception GeographicErr if the data cannot be written.
********************************************************************** / ********************************************************************** /
template<typename ExtT, typename IntT, bool bigendp> template<typename ExtT, typename IntT, bool bigendp>
static inline void writearray(std::ostream& str, static inline void writearray(std::ostream& str,
std::vector<IntT>& array) { std::vector<IntT>& array) {
writearray<ExtT, IntT, bigendp>(str, &array[0], array.size()); if (array.size() > 0)
writearray<ExtT, IntT, bigendp>(str, &array[0], array.size());
} }
/** /**
* Parse a KEY VALUE line. * Parse a KEY VALUE line.
* *
* @param[in] line the input line. * @param[in] line the input line.
* @param[out] key the key. * @param[out] key the key.
* @param[out] val the value. * @param[out] val the value.
* @exception std::bad_alloc if memory for the internal strings can't b e * @exception std::bad_alloc if memory for the internal strings can't b e
* allocated. * allocated.
 End of changes. 2 change blocks. 
2 lines changed or deleted 4 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/