Config.h   Config.h 
#define GEOGRAPHICLIB_VERSION_MAJOR 1 #define GEOGRAPHICLIB_VERSION_MAJOR 1
#define GEOGRAPHICLIB_VERSION_MINOR 42 #define GEOGRAPHICLIB_VERSION_MINOR 43
#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.42" #define GEOGRAPHICLIB_VERSION_STRING "1.43"
/* # undef GEOGRAPHICLIB_WORDS_BIGENDIAN */ /* # undef GEOGRAPHICLIB_WORDS_BIGENDIAN */
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 DMS.hpp   DMS.hpp 
skipping to change at line 246 skipping to change at line 246
********************************************************************** / ********************************************************************** /
static Math::real DecodeFraction(const std::string& str) static Math::real DecodeFraction(const std::string& str)
{ return Utility::fract<real>(str); } { return Utility::fract<real>(str); }
/// \endcond /// \endcond
/** /**
* Convert a pair of strings to latitude and longitude. * Convert a pair of strings to latitude and longitude.
* *
* @param[in] dmsa first string. * @param[in] dmsa first string.
* @param[in] dmsb second string. * @param[in] dmsb second string.
* @param[out] lat latitude. * @param[out] lat latitude (degrees).
* @param[out] lon longitude reduced to the range [&minus;180&deg;, * @param[out] lon longitude (degrees).
* 180&deg;).
* @param[in] swaplatlong if true assume longitude is given before lati tude * @param[in] swaplatlong if true assume longitude is given before lati tude
* in the absence of hemisphere designators (default false). * in the absence of hemisphere designators (default false).
* @exception GeographicErr if \e dmsa or \e dmsb is malformed. * @exception GeographicErr if \e dmsa or \e dmsb is malformed.
* @exception GeographicErr if \e dmsa and \e dmsb are both interpreted as * @exception GeographicErr if \e dmsa and \e dmsb are both interpreted as
* latitudes. * latitudes.
* @exception GeographicErr if \e dmsa and \e dmsb are both interpreted as * @exception GeographicErr if \e dmsa and \e dmsb are both interpreted as
* longitudes. * longitudes.
* @exception GeographicErr if decoded latitude is not in [&minus;90&de g;, * @exception GeographicErr if decoded latitude is not in [&minus;90&de g;,
* 90&deg;]. * 90&deg;].
* @exception GeographicErr if decoded longitude is not in * @exception GeographicErr if decoded longitude is not in
* [&minus;540&deg;, 540&deg;). * [&minus;540&deg;, 540&deg;).
* *
* By default, the \e lat (resp., \e lon) is assigned to the results of * By default, the \e lat (resp., \e lon) is assigned to the results of
* decoding \e dmsa (resp., \e dmsb). However this is overridden if ei ther * decoding \e dmsa (resp., \e dmsb). However this is overridden if ei ther
* \e dmsa or \e dmsb contain a latitude or longitude hemisphere design ator * \e dmsa or \e dmsb contain a latitude or longitude hemisphere design ator
* (N, S, E, W). If an exception is thrown, \e lat and \e lon are * (N, S, E, W). If an exception is thrown, \e lat and \e lon are
* unchanged. * unchanged.
********************************************************************** / ********************************************************************** /
static void DecodeLatLon(const std::string& dmsa, const std::string& dm sb, static void DecodeLatLon(const std::string& dmsa, const std::string& dm sb,
real& lat, real& lon, bool swaplatlong = false real& lat, real& lon,
); bool swaplatlong = false);
/** /**
* Convert a string to an angle in degrees. * Convert a string to an angle in degrees.
* *
* @param[in] angstr input string. * @param[in] angstr input string.
* @exception GeographicErr if \e angstr is malformed. * @exception GeographicErr if \e angstr is malformed.
* @exception GeographicErr if \e angstr includes a hemisphere designat or. * @exception GeographicErr if \e angstr includes a hemisphere designat or.
* @return angle (degrees) * @return angle (degrees)
* *
* No hemisphere designator is allowed and no check is done on the rang e of * No hemisphere designator is allowed and no check is done on the rang e of
 End of changes. 2 change blocks. 
5 lines changed or deleted 4 lines changed or added


 Geocentric.hpp   Geocentric.hpp 
skipping to change at line 76 skipping to change at line 76
class GEOGRAPHICLIB_EXPORT Geocentric { class GEOGRAPHICLIB_EXPORT Geocentric {
private: private:
typedef Math::real real; typedef Math::real real;
friend class LocalCartesian; friend class LocalCartesian;
friend class MagneticCircle; // MagneticCircle uses Rotation friend class MagneticCircle; // MagneticCircle uses Rotation
friend class MagneticModel; // MagneticModel uses IntForward friend class MagneticModel; // MagneticModel uses IntForward
friend class GravityCircle; // GravityCircle uses Rotation friend class GravityCircle; // GravityCircle uses Rotation
friend class GravityModel; // GravityModel uses IntForward friend class GravityModel; // GravityModel uses IntForward
friend class NormalGravity; // NormalGravity uses IntForward friend class NormalGravity; // NormalGravity uses IntForward
friend class SphericalHarmonic;
friend class SphericalHarmonic1;
friend class SphericalHarmonic2;
static const size_t dim_ = 3; static const size_t dim_ = 3;
static const size_t dim2_ = dim_ * dim_; static const size_t dim2_ = dim_ * dim_;
real _a, _f, _e2, _e2m, _e2a, _e4a, _maxrad; real _a, _f, _e2, _e2m, _e2a, _e4a, _maxrad;
static void Rotation(real sphi, real cphi, real slam, real clam, static void Rotation(real sphi, real cphi, real slam, real clam,
real M[dim2_]); real M[dim2_]);
static void Rotate(real M[dim2_], real x, real y, real z, static void Rotate(real M[dim2_], real x, real y, real z,
real& X, real& Y, real& Z) { real& X, real& Y, real& Z) {
// Perform [X,Y,Z]^t = M.[x,y,z]^t // Perform [X,Y,Z]^t = M.[x,y,z]^t
// (typically local cartesian to geocentric) // (typically local cartesian to geocentric)
X = M[0] * x + M[1] * y + M[2] * z; X = M[0] * x + M[1] * y + M[2] * z;
 End of changes. 1 change blocks. 
3 lines changed or deleted 0 lines changed or added


 Geodesic.hpp   Geodesic.hpp 
skipping to change at line 18 skipping to change at line 18
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_GEODESIC_HPP) #if !defined(GEOGRAPHICLIB_GEODESIC_HPP)
#define GEOGRAPHICLIB_GEODESIC_HPP 1 #define GEOGRAPHICLIB_GEODESIC_HPP 1
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#if !defined(GEOGRAPHICLIB_GEODESIC_ORDER) #if !defined(GEOGRAPHICLIB_GEODESIC_ORDER)
/** /**
* The order of the expansions used by Geodesic. * The order of the expansions used by Geodesic.
* GEOGRAPHICLIB_GEODESIC_ORDER can be set to any integer in [0, 8]. * GEOGRAPHICLIB_GEODESIC_ORDER can be set to any integer in [3, 8].
**********************************************************************/ **********************************************************************/
# define GEOGRAPHICLIB_GEODESIC_ORDER \ # define GEOGRAPHICLIB_GEODESIC_ORDER \
(GEOGRAPHICLIB_PRECISION == 2 ? 6 : \ (GEOGRAPHICLIB_PRECISION == 2 ? 6 : \
(GEOGRAPHICLIB_PRECISION == 1 ? 3 : \ (GEOGRAPHICLIB_PRECISION == 1 ? 3 : \
(GEOGRAPHICLIB_PRECISION == 3 ? 7 : 8))) (GEOGRAPHICLIB_PRECISION == 3 ? 7 : 8)))
#endif #endif
namespace GeographicLib { namespace GeographicLib {
class GeodesicLine; class GeodesicLine;
skipping to change at line 200 skipping to change at line 200
enum captype { enum captype {
CAP_NONE = 0U, CAP_NONE = 0U,
CAP_C1 = 1U<<0, CAP_C1 = 1U<<0,
CAP_C1p = 1U<<1, CAP_C1p = 1U<<1,
CAP_C2 = 1U<<2, CAP_C2 = 1U<<2,
CAP_C3 = 1U<<3, CAP_C3 = 1U<<3,
CAP_C4 = 1U<<4, CAP_C4 = 1U<<4,
CAP_ALL = 0x1FU, CAP_ALL = 0x1FU,
CAP_MASK = CAP_ALL, CAP_MASK = CAP_ALL,
OUT_ALL = 0x7F80U, OUT_ALL = 0x7F80U,
OUT_MASK = 0xFF80U, // Includes LONG_NOWRAP OUT_MASK = 0xFF80U, // Includes LONG_UNROLL
}; };
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);
static real Astroid(real x, real y); static real Astroid(real x, real y);
real _a, _f, _f1, _e2, _ep2, _n, _b, _c2, _etol2; real _a, _f, _f1, _e2, _ep2, _n, _b, _c2, _etol2;
real _A3x[nA3x_], _C3x[nC3x_], _C4x[nC4x_]; real _A3x[nA3x_], _C3x[nC3x_], _C4x[nC4x_];
void Lengths(real eps, real sig12, void Lengths(real eps, real sig12,
skipping to change at line 308 skipping to change at line 308
* Calculate geodesic scales \e M12 and \e M21. * Calculate geodesic scales \e M12 and \e M21.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
GEODESICSCALE = 1U<<13 | CAP_C1 | CAP_C2, GEODESICSCALE = 1U<<13 | CAP_C1 | CAP_C2,
/** /**
* Calculate area \e S12. * Calculate area \e S12.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
AREA = 1U<<14 | CAP_C4, AREA = 1U<<14 | CAP_C4,
/** /**
* Do not wrap the \e lon2 in the direct calculation. * Unroll \e lon2 in the direct calculation. (This flag used to be
* called LONG_NOWRAP.)
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
LONG_NOWRAP = 1U<<15, LONG_UNROLL = 1U<<15,
/// \cond SKIP
LONG_NOWRAP = LONG_UNROLL,
/// \endcond
/** /**
* All capabilities, calculate everything. (LONG_NOWRAP is not * All capabilities, calculate everything. (LONG_UNROLL is not
* included in this mask.) * included in this mask.)
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
ALL = OUT_ALL| CAP_ALL, ALL = OUT_ALL| CAP_ALL,
}; };
/** \name Constructor /** \name Constructor
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
skipping to change at line 613 skipping to change at line 617
* - \e outmask |= Geodesic::LATITUDE for the latitude \e lat2; * - \e outmask |= Geodesic::LATITUDE for the latitude \e lat2;
* - \e outmask |= Geodesic::LONGITUDE for the latitude \e lon2; * - \e outmask |= Geodesic::LONGITUDE for the latitude \e lon2;
* - \e outmask |= Geodesic::AZIMUTH for the latitude \e azi2; * - \e outmask |= Geodesic::AZIMUTH for the latitude \e azi2;
* - \e outmask |= Geodesic::DISTANCE for the distance \e s12; * - \e outmask |= Geodesic::DISTANCE for the distance \e s12;
* - \e outmask |= Geodesic::REDUCEDLENGTH for the reduced length \e * - \e outmask |= Geodesic::REDUCEDLENGTH for the reduced length \e
* m12; * m12;
* - \e outmask |= Geodesic::GEODESICSCALE for the geodesic scales \e * - \e outmask |= Geodesic::GEODESICSCALE for the geodesic scales \e
* M12 and \e M21; * M12 and \e M21;
* - \e outmask |= Geodesic::AREA for the area \e S12; * - \e outmask |= Geodesic::AREA for the area \e S12;
* - \e outmask |= Geodesic::ALL for all of the above; * - \e outmask |= Geodesic::ALL for all of the above;
* - \e outmask |= Geodesic::LONG_NOWRAP stops the returned value of \e * - \e outmask |= Geodesic::LONG_UNROLL to unroll \e lon2 instead of
* lon2 being wrapped into the range [&minus;180&deg;, 180&deg;). * wrapping it into the range [&minus;180&deg;, 180&deg;).
* . * .
* The function value \e a12 is always computed and returned and this * The function value \e a12 is always computed and returned and this
* equals \e s12_a12 is \e arcmode is true. If \e outmask includes * equals \e s12_a12 is \e arcmode is true. If \e outmask includes
* Geodesic::DISTANCE and \e arcmode is false, then \e s12 = \e s12_a12 . * Geodesic::DISTANCE and \e arcmode is false, then \e s12 = \e s12_a12 .
* It is not necessary to include Geodesic::DISTANCE_IN in \e outmask; this * It is not necessary to include Geodesic::DISTANCE_IN in \e outmask; this
* is automatically included is \e arcmode is false. * is automatically included is \e arcmode is false.
* *
* With the LONG_NOWRAP bit set, the quantity \e lon2 &minus; \e lon1 * With the Geodesic::LONG_UNROLL bit set, the quantity \e lon2 &minus;
* indicates how many times the geodesic wrapped around the ellipsoid. \e
* Because \e lon2 might be outside the normal allowed range for * lon1 indicates how many times and in what sense the geodesic encircl
* longitudes, [&minus;540&deg;, 540&deg;), be sure to normalize it wit es
h * the ellipsoid. Because \e lon2 might be outside the normal allowed
* Math::AngNormalize2 before using it in other GeographicLib calls. * range for longitudes, [&minus;540&deg;, 540&deg;), be sure to normal
ize
* it with Math::AngNormalize2 before using it in other GeographicLib
* calls.
********************************************************************** / ********************************************************************** /
Math::real GenDirect(real lat1, real lon1, real azi1, Math::real GenDirect(real lat1, real lon1, real azi1,
bool arcmode, real s12_a12, unsigned outmask, bool arcmode, real s12_a12, unsigned outmask,
real& lat2, real& lon2, real& azi2, real& lat2, real& lon2, real& azi2,
real& s12, real& m12, real& M12, real& M21, real& s12, real& m12, real& M12, real& M21,
real& S12) const; real& S12) const;
///@} ///@}
/** \name Inverse geodesic problem. /** \name Inverse geodesic problem.
********************************************************************** / ********************************************************************** /
 End of changes. 7 change blocks. 
13 lines changed or deleted 20 lines changed or added


 GeodesicExact.hpp   GeodesicExact.hpp 
skipping to change at line 100 skipping to change at line 100
enum captype { enum captype {
CAP_NONE = 0U, CAP_NONE = 0U,
CAP_E = 1U<<0, CAP_E = 1U<<0,
// Skip 1U<<1 for compatibility with Geodesic (not required) // Skip 1U<<1 for compatibility with Geodesic (not required)
CAP_D = 1U<<2, CAP_D = 1U<<2,
CAP_H = 1U<<3, CAP_H = 1U<<3,
CAP_C4 = 1U<<4, CAP_C4 = 1U<<4,
CAP_ALL = 0x1FU, CAP_ALL = 0x1FU,
CAP_MASK = CAP_ALL, CAP_MASK = CAP_ALL,
OUT_ALL = 0x7F80U, OUT_ALL = 0x7F80U,
OUT_MASK = 0xFF80U, // Includes LONG_NOWRAP OUT_MASK = 0xFF80U, // Includes LONG_UNROLL
}; };
static real CosSeries(real sinx, real cosx, const real c[], int n); static real CosSeries(real sinx, real cosx, const real c[], int n);
static real Astroid(real x, real y); static real Astroid(real x, real y);
real _a, _f, _f1, _e2, _ep2, _n, _b, _c2, _etol2; real _a, _f, _f1, _e2, _ep2, _n, _b, _c2, _etol2;
real _C4x[nC4x_]; real _C4x[nC4x_];
void Lengths(const EllipticFunction& E, void Lengths(const EllipticFunction& E,
real sig12, real sig12,
skipping to change at line 142 skipping to change at line 142
void C4coeff(); void C4coeff();
void C4f(real k2, real c[]) const; void C4f(real k2, real c[]) const;
// Large coefficients are split so that lo contains the low 52 bits and hi // Large coefficients are split so that lo contains the low 52 bits and hi
// the rest. This choice avoids double rounding with doubles and highe r // the rest. This choice avoids double rounding with doubles and highe r
// precision types. float coefficients will suffer double rounding; // precision types. float coefficients will suffer double rounding;
// however the accuracy is already lousy for floats. // however the accuracy is already lousy for floats.
static Math::real inline reale(long long hi, long long lo) { static Math::real inline reale(long long hi, long long lo) {
using std::ldexp; using std::ldexp;
return ldexp(real(hi), 52) + lo; return ldexp(real(hi), 52) + lo;
} }
static const Math::real* rawC4coeff();
public: public:
/** /**
* Bit masks for what calculations to do. These masks do double duty. * Bit masks for what calculations to do. These masks do double duty.
* They signify to the GeodesicLineExact::GeodesicLineExact constructor and * They signify to the GeodesicLineExact::GeodesicLineExact constructor and
* to GeodesicExact::Line what capabilities should be included in the * to GeodesicExact::Line what capabilities should be included in the
* GeodesicLineExact object. They also specify which results to return in * GeodesicLineExact object. They also specify which results to return in
* the general routines GeodesicExact::GenDirect and * the general routines GeodesicExact::GenDirect and
* GeodesicExact::GenInverse routines. GeodesicLineExact::mask is a * GeodesicExact::GenInverse routines. GeodesicLineExact::mask is a
skipping to change at line 206 skipping to change at line 205
* Calculate geodesic scales \e M12 and \e M21. * Calculate geodesic scales \e M12 and \e M21.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
GEODESICSCALE = 1U<<13 | CAP_D, GEODESICSCALE = 1U<<13 | CAP_D,
/** /**
* Calculate area \e S12. * Calculate area \e S12.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
AREA = 1U<<14 | CAP_C4, AREA = 1U<<14 | CAP_C4,
/** /**
* Do not wrap the \e lon2 in the direct calculation. * Unroll \e lon2 in the direct calculation. (This flag used to be
* called LONG_NOWRAP.)
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
LONG_NOWRAP = 1U<<15, LONG_UNROLL = 1U<<15,
/// \cond SKIP
LONG_NOWRAP = LONG_UNROLL,
/// \endcond
/** /**
* All capabilities, calculate everything. (LONG_NOWRAP is not * All capabilities, calculate everything. (LONG_UNROLL is not
* included in this mask.) * included in this mask.)
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
ALL = OUT_ALL| CAP_ALL, ALL = OUT_ALL| CAP_ALL,
}; };
/** \name Constructor /** \name Constructor
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
skipping to change at line 511 skipping to change at line 514
* - \e outmask |= GeodesicExact::LATITUDE for the latitude \e lat2; * - \e outmask |= GeodesicExact::LATITUDE for the latitude \e lat2;
* - \e outmask |= GeodesicExact::LONGITUDE for the latitude \e lon2; * - \e outmask |= GeodesicExact::LONGITUDE for the latitude \e lon2;
* - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2; * - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2;
* - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12; * - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12;
* - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length \e * - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length \e
* m12; * m12;
* - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales \e * - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales \e
* M12 and \e M21; * M12 and \e M21;
* - \e outmask |= GeodesicExact::AREA for the area \e S12; * - \e outmask |= GeodesicExact::AREA for the area \e S12;
* - \e outmask |= GeodesicExact::ALL for all of the above; * - \e outmask |= GeodesicExact::ALL for all of the above;
* - \e outmask |= GeodesicExact::LONG_NOWRAP stops the returned value * - \e outmask |= GeodesicExact::LONG_UNROLL to unroll \e lon2 instead
of of
* \e lon2 being wrapped into the range [&minus;180&deg;, 180&deg;). * wrapping it into the range [&minus;180&deg;, 180&deg;).
* . * .
* The function value \e a12 is always computed and returned and this * The function value \e a12 is always computed and returned and this
* equals \e s12_a12 is \e arcmode is true. If \e outmask includes * equals \e s12_a12 is \e arcmode is true. If \e outmask includes
* GeodesicExact::DISTANCE and \e arcmode is false, then \e s12 = \e * GeodesicExact::DISTANCE and \e arcmode is false, then \e s12 = \e
* s12_a12. It is not necessary to include GeodesicExact::DISTANCE_IN in * s12_a12. It is not necessary to include GeodesicExact::DISTANCE_IN in
* \e outmask; this is automatically included is \e arcmode is false. * \e outmask; this is automatically included is \e arcmode is false.
* *
* With the LONG_NOWRAP bit set, the quantity \e lon2 &minus; \e lon1 * With the GeodesicExact::LONG_UNROLL bit set, the quantity \e lon2
* indicates how many times the geodesic wrapped around the ellipsoid. * &minus; \e lon1 indicates how many times and in what sense the geode
* Because \e lon2 might be outside the normal allowed range for sic
* longitudes, [&minus;540&deg;, 540&deg;), be sure to normalize it wit * encircles the ellipsoid. Because \e lon2 might be outside the norma
h l
* Math::AngNormalize2 before using it in other GeographicLib calls. * allowed range for longitudes, [&minus;540&deg;, 540&deg;), be sure t
o
* normalize it with Math::AngNormalize2 before using it in other
* GeographicLib calls.
********************************************************************** / ********************************************************************** /
Math::real GenDirect(real lat1, real lon1, real azi1, Math::real GenDirect(real lat1, real lon1, real azi1,
bool arcmode, real s12_a12, unsigned outmask, bool arcmode, real s12_a12, unsigned outmask,
real& lat2, real& lon2, real& azi2, real& lat2, real& lon2, real& azi2,
real& s12, real& m12, real& M12, real& M21, real& s12, real& m12, real& M12, real& M21,
real& S12) const; real& S12) const;
///@} ///@}
/** \name Inverse geodesic problem. /** \name Inverse geodesic problem.
********************************************************************** / ********************************************************************** /
 End of changes. 7 change blocks. 
14 lines changed or deleted 20 lines changed or added


 GeodesicLine.hpp   GeodesicLine.hpp 
skipping to change at line 150 skipping to change at line 150
* Calculate geodesic scales \e M12 and \e M21. * Calculate geodesic scales \e M12 and \e M21.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
GEODESICSCALE = Geodesic::GEODESICSCALE, GEODESICSCALE = Geodesic::GEODESICSCALE,
/** /**
* Calculate area \e S12. * Calculate area \e S12.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
AREA = Geodesic::AREA, AREA = Geodesic::AREA,
/** /**
* Do not wrap \e lon2 in the direct calculation. * Unroll \e lon2 in the direct calculation. (This flag used to be
* called LONG_NOWRAP.)
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
LONG_NOWRAP = Geodesic::LONG_NOWRAP, LONG_UNROLL = Geodesic::LONG_UNROLL,
/// \cond SKIP
LONG_NOWRAP = LONG_UNROLL,
/// \endcond
/** /**
* All capabilities, calculate everything. (LONG_NOWRAP is not * All capabilities, calculate everything. (LONG_UNROLL is not
* included in this mask.) * included in this mask.)
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
ALL = Geodesic::ALL, ALL = Geodesic::ALL,
}; };
/** \name Constructors /** \name Constructors
********************************************************************** / ********************************************************************** /
///@{ ///@{
skipping to change at line 505 skipping to change at line 509
* - \e outmask |= GeodesicLine::LATITUDE for the latitude \e lat2; * - \e outmask |= GeodesicLine::LATITUDE for the latitude \e lat2;
* - \e outmask |= GeodesicLine::LONGITUDE for the latitude \e lon2; * - \e outmask |= GeodesicLine::LONGITUDE for the latitude \e lon2;
* - \e outmask |= GeodesicLine::AZIMUTH for the latitude \e azi2; * - \e outmask |= GeodesicLine::AZIMUTH for the latitude \e azi2;
* - \e outmask |= GeodesicLine::DISTANCE for the distance \e s12; * - \e outmask |= GeodesicLine::DISTANCE for the distance \e s12;
* - \e outmask |= GeodesicLine::REDUCEDLENGTH for the reduced length \ e * - \e outmask |= GeodesicLine::REDUCEDLENGTH for the reduced length \ e
* m12; * m12;
* - \e outmask |= GeodesicLine::GEODESICSCALE for the geodesic scales \e * - \e outmask |= GeodesicLine::GEODESICSCALE for the geodesic scales \e
* M12 and \e M21; * M12 and \e M21;
* - \e outmask |= GeodesicLine::AREA for the area \e S12; * - \e outmask |= GeodesicLine::AREA for the area \e S12;
* - \e outmask |= GeodesicLine::ALL for all of the above; * - \e outmask |= GeodesicLine::ALL for all of the above;
* - \e outmask |= GeodesicLine::LONG_NOWRAP stops the returned value o * - \e outmask |= GeodesicLine::LONG_UNROLL to unroll \e lon2 instead
f \e of
* lon2 being wrapped into the range [&minus;180&deg;, 180&deg;). * reducing it into the range [&minus;180&deg;, 180&deg;).
* . * .
* Requesting a value which the GeodesicLine object is not capable of * Requesting a value which the GeodesicLine object is not capable of
* computing is not an error; the corresponding argument will not be * computing is not an error; the corresponding argument will not be
* altered. Note, however, that the arc length is always computed and * altered. Note, however, that the arc length is always computed and
* returned as the function value. * returned as the function value.
* *
* With the LONG_NOWRAP bit set, the quantity \e lon2 &minus; \e lon1 * With the GeodesicLine::LONG_UNROLL bit set, the quantity \e lon2 &mi
* indicates how many times the geodesic wrapped around the ellipsoid. nus;
* Because \e lon2 might be outside the normal allowed range for * \e lon1 indicates how many times and in what sense the geodesic
* longitudes, [&minus;540&deg;, 540&deg;), be sure to normalize it wit * encircles the ellipsoid. Because \e lon2 might be outside the norma
h l
* Math::AngNormalize2 before using it in other GeographicLib calls. * allowed range for longitudes, [&minus;540&deg;, 540&deg;), be sure t
o
* normalize it with Math::AngNormalize2 before using it in other
* GeographicLib calls.
********************************************************************** / ********************************************************************** /
Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask, Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask,
real& lat2, real& lon2, real& azi2, real& lat2, real& lon2, real& azi2,
real& s12, real& m12, real& M12, real& M21, real& s12, real& m12, real& M12, real& M21,
real& S12) const; real& S12) const;
///@} ///@}
/** \name Inspector functions /** \name Inspector functions
********************************************************************** / ********************************************************************** /
 End of changes. 5 change blocks. 
12 lines changed or deleted 19 lines changed or added


 GeodesicLineExact.hpp   GeodesicLineExact.hpp 
skipping to change at line 122 skipping to change at line 122
* Calculate geodesic scales \e M12 and \e M21. * Calculate geodesic scales \e M12 and \e M21.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
GEODESICSCALE = GeodesicExact::GEODESICSCALE, GEODESICSCALE = GeodesicExact::GEODESICSCALE,
/** /**
* Calculate area \e S12. * Calculate area \e S12.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
AREA = GeodesicExact::AREA, AREA = GeodesicExact::AREA,
/** /**
* Do not wrap \e lon2 in the direct calculation. * Unroll \e lon2 in the direct calculation. (This flag used to be
* called LONG_NOWRAP.)
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
LONG_NOWRAP = GeodesicExact::LONG_NOWRAP, LONG_UNROLL = GeodesicExact::LONG_UNROLL,
/// \cond SKIP
LONG_NOWRAP = LONG_UNROLL,
/// \endcond
/** /**
* All capabilities, calculate everything. (LONG_NOWRAP is not * All capabilities, calculate everything. (LONG_UNROLL is not
* included in this mask.) * included in this mask.)
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
ALL = GeodesicExact::ALL, ALL = GeodesicExact::ALL,
}; };
/** \name Constructors /** \name Constructors
********************************************************************** / ********************************************************************** /
///@{ ///@{
skipping to change at line 479 skipping to change at line 483
* - \e outmask |= GeodesicLineExact::LATITUDE for the latitude \e lat2 ; * - \e outmask |= GeodesicLineExact::LATITUDE for the latitude \e lat2 ;
* - \e outmask |= GeodesicLineExact::LONGITUDE for the latitude \e lon 2; * - \e outmask |= GeodesicLineExact::LONGITUDE for the latitude \e lon 2;
* - \e outmask |= GeodesicLineExact::AZIMUTH for the latitude \e azi2; * - \e outmask |= GeodesicLineExact::AZIMUTH for the latitude \e azi2;
* - \e outmask |= GeodesicLineExact::DISTANCE for the distance \e s12; * - \e outmask |= GeodesicLineExact::DISTANCE for the distance \e s12;
* - \e outmask |= GeodesicLineExact::REDUCEDLENGTH for the reduced len gth * - \e outmask |= GeodesicLineExact::REDUCEDLENGTH for the reduced len gth
* \e m12; * \e m12;
* - \e outmask |= GeodesicLineExact::GEODESICSCALE for the geodesic sc ales * - \e outmask |= GeodesicLineExact::GEODESICSCALE for the geodesic sc ales
* \e M12 and \e M21; * \e M12 and \e M21;
* - \e outmask |= GeodesicLineExact::AREA for the area \e S12; * - \e outmask |= GeodesicLineExact::AREA for the area \e S12;
* - \e outmask |= GeodesicLineExact::ALL for all of the above; * - \e outmask |= GeodesicLineExact::ALL for all of the above;
* - \e outmask |= GeodesicLineExact::LONG_NOWRAP stops the returned va * - \e outmask |= GeodesicLineExact::LONG_UNROLL to unroll \e lon2 ins
lue tead
* of \e lon2 being wrapped into the range [&minus;180&deg;, 180&deg; * of wrapping it into the range [&minus;180&deg;, 180&deg;).
).
* . * .
* Requesting a value which the GeodesicLineExact object is not capable of * Requesting a value which the GeodesicLineExact object is not capable of
* computing is not an error; the corresponding argument will not be * computing is not an error; the corresponding argument will not be
* altered. Note, however, that the arc length is always computed and * altered. Note, however, that the arc length is always computed and
* returned as the function value. * returned as the function value.
* *
* With the LONG_NOWRAP bit set, the quantity \e lon2 &minus; \e lon1 * With the GeodesicLineExact::LONG_UNROLL bit set, the quantity \e lon
* indicates how many times the geodesic wrapped around the ellipsoid. 2
* Because \e lon2 might be outside the normal allowed range for * &minus; \e lon1 indicates how many times and in what sense the geode
* longitudes, [&minus;540&deg;, 540&deg;), be sure to normalize it wit sic
h * encircles the ellipsoid. Because \e lon2 might be outside the norma
* Math::AngNormalize2 before using it in other GeographicLib calls. l
* allowed range for longitudes, [&minus;540&deg;, 540&deg;), be sure t
o
* normalize it with Math::AngNormalize2 before using it in other
* GeographicLib calls.
********************************************************************** / ********************************************************************** /
Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask, Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask,
real& lat2, real& lon2, real& azi2, real& lat2, real& lon2, real& azi2,
real& s12, real& m12, real& M12, real& M21, real& s12, real& m12, real& M12, real& M21,
real& S12) const; real& S12) const;
///@} ///@}
/** \name Inspector functions /** \name Inspector functions
********************************************************************** / ********************************************************************** /
 End of changes. 5 change blocks. 
13 lines changed or deleted 20 lines changed or added


 Geoid.hpp   Geoid.hpp 
skipping to change at line 37 skipping to change at line 37
* to 4 uses a maxval of 2<sup>32</sup>&minus;1 and changes the extension f or * to 4 uses a maxval of 2<sup>32</sup>&minus;1 and changes the extension f or
* the data files from .pgm to .pgm4. Note that the format of these pgm4 f iles * the data files from .pgm to .pgm4. Note that the format of these pgm4 f iles
* is a non-standard extension of the pgm format. * is a non-standard extension of the pgm format.
**********************************************************************/ **********************************************************************/
# define GEOGRAPHICLIB_GEOID_PGM_PIXEL_WIDTH 2 # define GEOGRAPHICLIB_GEOID_PGM_PIXEL_WIDTH 2
#endif #endif
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief Looking up the height of the geoid * \brief Looking up the height of the geoid above the ellipsoid
* *
* This class evaluated the height of one of the standard geoids, EGM84, * This class evaluates the height of one of the standard geoids, EGM84,
* EGM96, or EGM2008 by bilinear or cubic interpolation into a rectangula r * EGM96, or EGM2008 by bilinear or cubic interpolation into a rectangula r
* grid of data. These geoid models are documented in * grid of data. These geoid models are documented in
* - EGM84: * - EGM84:
* http://earth-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/wgs84_180 .html * http://earth-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/wgs84_180 .html
* - EGM96: * - EGM96:
* http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html * http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html
* - EGM2008: * - EGM2008:
* http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm2008 * http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm2008
* *
* The geoids are defined in terms of spherical harmonics. However in or der * The geoids are defined in terms of spherical harmonics. However in or der
* to provide a quick and flexible method of evaluating the geoid heights , * to provide a quick and flexible method of evaluating the geoid heights ,
* this class evaluates the height by interpolation into a grid of * this class evaluates the height by interpolation into a grid of
* precomputed values. * precomputed values.
* *
* The geoid height, \e N, can be used to convert a height above the * The height of the geoid above the ellipsoid, \e N, is sometimes called
* ellipsoid, \e h, to the corresponding height above the geoid (roughly the
the * geoid undulation. It can be used to convert a height above the ellips
* height above mean sea level), \e H, using the relations oid,
* \e h, to the corresponding height above the geoid (the orthometric hei
ght,
* roughly the height above mean sea level), \e H, using the relations
* *
* &nbsp;&nbsp;&nbsp;\e h = \e N + \e H; * &nbsp;&nbsp;&nbsp;\e h = \e N + \e H;
* &nbsp;&nbsp;\e H = &minus;\e N + \e h. * &nbsp;&nbsp;\e H = &minus;\e N + \e h.
* *
* See \ref geoid for details of how to install the data sets, the data * See \ref geoid for details of how to install the data sets, the data
* format, estimates of the interpolation errors, and how to use caching. * format, estimates of the interpolation errors, and how to use caching.
* *
* In addition to returning the geoid height, the gradient of the geoid c an * In addition to returning the geoid height, the gradient of the geoid c an
* be calculated. The gradient is defined as the rate of change of the g eoid * be calculated. The gradient is defined as the rate of change of the g eoid
* as a function of position on the ellipsoid. This uses the parameters for * as a function of position on the ellipsoid. This uses the parameters for
skipping to change at line 292 skipping to change at line 293
/** \name Compute geoid heights /** \name Compute geoid heights
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* Compute the geoid height at a point * Compute the geoid height at a point
* *
* @param[in] lat latitude of the point (degrees). * @param[in] lat latitude of the point (degrees).
* @param[in] lon longitude of the point (degrees). * @param[in] lon longitude of the point (degrees).
* @exception GeographicErr if there's a problem reading the data; this * @exception GeographicErr if there's a problem reading the data; this
* never happens if (\e lat, \e lon) is within a successfully cached area. * never happens if (\e lat, \e lon) is within a successfully cached area.
* @return geoid height (meters). * @return the height of the geoid above the ellipsoid (meters).
* *
* The latitude should be in [&minus;90&deg;, 90&deg;] and * The latitude should be in [&minus;90&deg;, 90&deg;] and
* longitude should be in [&minus;540&deg;, 540&deg;). * longitude should be in [&minus;540&deg;, 540&deg;).
********************************************************************** / ********************************************************************** /
Math::real operator()(real lat, real lon) const { Math::real operator()(real lat, real lon) const {
real gradn, grade; real gradn, grade;
return height(lat, lon, false, gradn, grade); return height(lat, lon, false, gradn, grade);
} }
/** /**
 End of changes. 4 change blocks. 
7 lines changed or deleted 10 lines changed or added


 GravityModel.hpp   GravityModel.hpp 
skipping to change at line 36 skipping to change at line 36
class GravityCircle; class GravityCircle;
/** /**
* \brief Model of the earth's gravity field * \brief Model of the earth's gravity field
* *
* Evaluate the earth's gravity field according to a model. The supporte d * Evaluate the earth's gravity field according to a model. The supporte d
* models treat only the gravitational field exterior to the mass of the * models treat only the gravitational field exterior to the mass of the
* earth. When computing the field at points near (but above) the surfac e of * earth. When computing the field at points near (but above) the surfac e of
* the earth a small correction can be applied to account for the mass of the * the earth a small correction can be applied to account for the mass of the
* atomsphere above the point in question; see \ref gravityatmos. * atomsphere above the point in question; see \ref gravityatmos.
* Determining the geoid height entails correcting for the mass of the ea * Determining the height of the geoid above the ellipsoid entails correc
rth ting
* above the geoid. The egm96 and egm2008 include separate correction te * for the mass of the earth above the geoid. The egm96 and egm2008 incl
rms ude
* to account for this mass. * separate correction terms to account for this mass.
* *
* Definitions and terminology (from Heiskanen and Moritz, Sec 2-13): * Definitions and terminology (from Heiskanen and Moritz, Sec 2-13):
* - \e V = gravitational potential; * - \e V = gravitational potential;
* - &Phi; = rotational potential; * - &Phi; = rotational potential;
* - \e W = \e V + &Phi; = \e T + \e U = total potential; * - \e W = \e V + &Phi; = \e T + \e U = total potential;
* - <i>V</i><sub>0</sub> = normal gravitation potential; * - <i>V</i><sub>0</sub> = normal gravitation potential;
* - \e U = <i>V</i><sub>0</sub> + &Phi; = total normal potential; * - \e U = <i>V</i><sub>0</sub> + &Phi; = total normal potential;
* - \e T = \e W &minus; \e U = \e V &minus; <i>V</i><sub>0</sub> = anoma lous * - \e T = \e W &minus; \e U = \e V &minus; <i>V</i><sub>0</sub> = anoma lous
* or disturbing potential; * or disturbing potential;
* - <b>g</b> = &nabla;\e W = <b>&gamma;</b> + <b>&delta;</b>; * - <b>g</b> = &nabla;\e W = <b>&gamma;</b> + <b>&delta;</b>;
skipping to change at line 69 skipping to change at line 69
* potential at \e Q; * potential at \e Q;
* - &Delta;\e g = gravity anomaly = <i>g</i><sub><i>P</i></sub> &minus; * - &Delta;\e g = gravity anomaly = <i>g</i><sub><i>P</i></sub> &minus;
* &gamma;<sub><i>Q</i></sub>; * &gamma;<sub><i>Q</i></sub>;
* - (&xi;, &eta;) deflection of the vertical, the difference in * - (&xi;, &eta;) deflection of the vertical, the difference in
* directions of <b>g</b><sub><i>P</i></sub> and * directions of <b>g</b><sub><i>P</i></sub> and
* <b>&gamma;</b><sub><i>Q</i></sub>, &xi; = NS, &eta; = EW. * <b>&gamma;</b><sub><i>Q</i></sub>, &xi; = NS, &eta; = EW.
* - \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.
* *
* See \ref gravity for details of how to install the gravity model and t he * See \ref gravity for details of how to install the gravity models and the
* data format. * data format.
* *
* References: * References:
* - W. A. Heiskanen and H. Moritz, Physical Geodesy (Freeman, San * - W. A. Heiskanen and H. Moritz, Physical Geodesy (Freeman, San
* Francisco, 1967). * Francisco, 1967).
* *
* Example of use: * Example of use:
* \include example-GravityModel.cpp * \include example-GravityModel.cpp
* *
* <a href="Gravity.1.html">Gravity</a> is a command-line utility providi ng * <a href="Gravity.1.html">Gravity</a> is a command-line utility providi ng
 End of changes. 2 change blocks. 
6 lines changed or deleted 6 lines changed or added


 MGRS.hpp   MGRS.hpp 
/** /**
* \file MGRS.hpp * \file MGRS.hpp
* \brief Header for GeographicLib::MGRS class * \brief Header for GeographicLib::MGRS class
* *
* Copyright (c) Charles Karney (2008-2014) <charles@karney.com> and licens ed * Copyright (c) Charles Karney (2008-2015) <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 <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/UTMUPS.hpp> #include <GeographicLib/UTMUPS.hpp>
skipping to change at line 296 skipping to change at line 296
* @param[in] centerp if true (default), return center of the MGRS squa re, * @param[in] centerp if true (default), return center of the MGRS squa re,
* else return SW (lower left) corner. * else return SW (lower left) corner.
* @exception GeographicErr if \e mgrs is illegal. * @exception GeographicErr if \e mgrs is illegal.
* *
* All conversions from MGRS to UTM/UPS are permitted provided the MGRS * All conversions from MGRS to UTM/UPS are permitted provided the MGRS
* coordinate is a possible result of a conversion in the other directi on. * coordinate is a possible result of a conversion in the other directi on.
* (The leading 0 may be dropped from an input MGRS coordinate for UTM * (The leading 0 may be dropped from an input MGRS coordinate for UTM
* zones 1--9.) In addition, MGRS coordinates with a neighboring * zones 1--9.) In addition, MGRS coordinates with a neighboring
* latitude band letter are permitted provided that some portion of the * latitude band letter are permitted provided that some portion of the
* 100 km block is within the given latitude band. Thus * 100 km block is within the given latitude band. Thus
* - 38VLS and 38WLS are allowed (latitude 64N intersects the square * - 38VLS and 38WLS are allowed (latitude 64N intersects the square
* 38[VW]LS); but 38VMS is not permitted (all of 38VMS is north of * 38[VW]LS); but 38VMS is not permitted (all of 38WMS is north of 64
64N) N)
* - 38MPE and 38NPF are permitted (they straddle the equator); but 3 * - 38MPE and 38NPF are permitted (they straddle the equator); but 38N
8NPE PE
* and 38MPF are not permitted (the equator does not intersect eith * and 38MPF are not permitted (the equator does not intersect either
er * block).
* block). * - Similarly ZAB and YZB are permitted (they straddle the prime
* - Similarly ZAB and YZB are permitted (they straddle the prime * meridian); but YAB and ZZB are not (the prime meridian does not
* meridian); but YAB and ZZB are not (the prime meridian does not * intersect either block).
* intersect either block).
* *
* 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 * \e centerp = true, the conversion from MGRS to geographic and back i s
* 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 and \e prec is set to &minus;1. * 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, \e zone is set to UTMUPS::INVALID, and \e prec is set to * set to NaN, \e zone is set to UTMUPS::INVALID, and \e prec is set to
skipping to change at line 346 skipping to change at line 346
/** /**
* @return \e f the flattening of the WGS84 ellipsoid. * @return \e f the flattening of the WGS84 ellipsoid.
* *
* (The WGS84 value is returned because the UTM and UPS projections are * (The WGS84 value is returned because the UTM and UPS projections are
* based on this ellipsoid.) * based on this ellipsoid.)
********************************************************************** / ********************************************************************** /
static Math::real Flattening() { return UTMUPS::Flattening(); } static Math::real Flattening() { return UTMUPS::Flattening(); }
///@} ///@}
/**
* Perform some checks on the UTMUPS coordinates on this ellipsoid. Th
row
* an error if any of the assumptions made in the MGRS class is not tru
e.
* This check needs to be carried out if the ellipsoid parameters (or t
he
* UTM/UPS scales) are ever changed.
**********************************************************************
/
static void Check();
/// \cond SKIP /// \cond SKIP
/** /**
* <b>DEPRECATED</b> * <b>DEPRECATED</b>
* @return \e r the inverse flattening of the WGS84 ellipsoid. * @return \e r the inverse flattening of the WGS84 ellipsoid.
********************************************************************** / ********************************************************************** /
static Math::real InverseFlattening() static Math::real InverseFlattening()
{ return UTMUPS::InverseFlattening(); } { return UTMUPS::InverseFlattening(); }
/// \endcond /// \endcond
}; };
 End of changes. 4 change blocks. 
13 lines changed or deleted 24 lines changed or added


 MagneticCircle.hpp   MagneticCircle.hpp 
/** /**
* \file MagneticCircle.hpp * \file MagneticCircle.hpp
* \brief Header for GeographicLib::MagneticCircle class * \brief Header for GeographicLib::MagneticCircle class
* *
* Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un * Copyright (c) Charles Karney (2011-2015) <charles@karney.com> and licens
der ed
* the MIT/X11 License. For more information, see * under the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_MAGNETICCIRCLE_HPP) #if !defined(GEOGRAPHICLIB_MAGNETICCIRCLE_HPP)
#define GEOGRAPHICLIB_MAGNETICCIRCLE_HPP 1 #define GEOGRAPHICLIB_MAGNETICCIRCLE_HPP 1
#include <vector> #include <vector>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/CircularEngine.hpp> #include <GeographicLib/CircularEngine.hpp>
skipping to change at line 42 skipping to change at line 42
* *
* <a href="MagneticField.1.html">MagneticField</a> is a command-line uti lity * <a href="MagneticField.1.html">MagneticField</a> is a command-line uti lity
* providing access to the functionality of MagneticModel and MagneticCir cle. * providing access to the functionality of MagneticModel and MagneticCir cle.
**********************************************************************/ **********************************************************************/
class GEOGRAPHICLIB_EXPORT MagneticCircle { class GEOGRAPHICLIB_EXPORT MagneticCircle {
private: private:
typedef Math::real real; typedef Math::real real;
real _a, _f, _lat, _h, _t, _cphi, _sphi, _t1, _dt0; real _a, _f, _lat, _h, _t, _cphi, _sphi, _t1, _dt0;
bool _interpolate; bool _interpolate, _constterm;
CircularEngine _circ0, _circ1; CircularEngine _circ0, _circ1, _circ2;
MagneticCircle(real a, real f, real lat, real h, real t, MagneticCircle(real a, real f, real lat, real h, real t,
real cphi, real sphi, real t1, real dt0, real cphi, real sphi, real t1, real dt0,
bool interpolate, bool interpolate,
const CircularEngine& circ0, const CircularEngine& circ1 ) const CircularEngine& circ0, const CircularEngine& circ1 )
: _a(a) : _a(a)
, _f(f) , _f(f)
, _lat(lat) , _lat(lat)
, _h(h) , _h(h)
, _t(t) , _t(t)
, _cphi(cphi) , _cphi(cphi)
, _sphi(sphi) , _sphi(sphi)
, _t1(t1) , _t1(t1)
, _dt0(dt0) , _dt0(dt0)
, _interpolate(interpolate) , _interpolate(interpolate)
, _constterm(false)
, _circ0(circ0) , _circ0(circ0)
, _circ1(circ1) , _circ1(circ1)
{} {}
MagneticCircle(real a, real f, real lat, real h, real t,
real cphi, real sphi, real t1, real dt0,
bool interpolate,
const CircularEngine& circ0, const CircularEngine& circ1
,
const CircularEngine& circ2)
: _a(a)
, _f(f)
, _lat(lat)
, _h(h)
, _t(t)
, _cphi(cphi)
, _sphi(sphi)
, _t1(t1)
, _dt0(dt0)
, _interpolate(interpolate)
, _constterm(true)
, _circ0(circ0)
, _circ1(circ1)
, _circ2(circ2)
{}
void Field(real lon, bool diffp, void Field(real lon, bool diffp,
real& Bx, real& By, real& Bz, real& Bx, real& By, real& Bz,
real& Bxt, real& Byt, real& Bzt) const; real& Bxt, real& Byt, real& Bzt) const;
friend class MagneticModel; // MagneticModel calls the private construc tor friend class MagneticModel; // MagneticModel calls the private construc tor
public: public:
/** /**
* A default constructor for the normal gravity. This sets up an * A default constructor for the normal gravity. This sets up an
 End of changes. 4 change blocks. 
5 lines changed or deleted 28 lines changed or added


 MagneticModel.hpp   MagneticModel.hpp 
/** /**
* \file MagneticModel.hpp * \file MagneticModel.hpp
* \brief Header for GeographicLib::MagneticModel class * \brief Header for GeographicLib::MagneticModel class
* *
* Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un * Copyright (c) Charles Karney (2011-2015) <charles@karney.com> and licens
der ed
* the MIT/X11 License. For more information, see * under the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_MAGNETICMODEL_HPP) #if !defined(GEOGRAPHICLIB_MAGNETICMODEL_HPP)
#define GEOGRAPHICLIB_MAGNETICMODEL_HPP 1 #define GEOGRAPHICLIB_MAGNETICMODEL_HPP 1
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/Geocentric.hpp> #include <GeographicLib/Geocentric.hpp>
#include <GeographicLib/SphericalHarmonic.hpp> #include <GeographicLib/SphericalHarmonic.hpp>
skipping to change at line 36 skipping to change at line 36
/** /**
* \brief Model of the earth's magnetic field * \brief Model of the earth's magnetic field
* *
* Evaluate the earth's magnetic field according to a model. At present only * Evaluate the earth's magnetic field according to a model. At present only
* internal magnetic fields are handled. These are due to the earth's co de * internal magnetic fields are handled. These are due to the earth's co de
* and crust; these vary slowly (over many years). Excluded are the effe cts * and crust; these vary slowly (over many years). Excluded are the effe cts
* of currents in the ionosphere and magnetosphere which have daily and * of currents in the ionosphere and magnetosphere which have daily and
* annual variations. * annual variations.
* *
* See \ref magnetic for details of how to install the magnetic model and * See \ref magnetic for details of how to install the magnetic models an
the d
* data format. * the 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: * - WMM2015:
* - http://ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml * - http://ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml
* - http://ngdc.noaa.gov/geomag/WMM/data/WMM2015/WMM2015COF.zip * - http://ngdc.noaa.gov/geomag/WMM/data/WMM2015/WMM2015COF.zip
skipping to change at line 69 skipping to change at line 69
* <a href="MagneticField.1.html">MagneticField</a> is a command-line uti lity * <a href="MagneticField.1.html">MagneticField</a> is a command-line uti lity
* providing access to the functionality of MagneticModel and MagneticCir cle. * providing access to the functionality of MagneticModel and MagneticCir cle.
**********************************************************************/ **********************************************************************/
class GEOGRAPHICLIB_EXPORT MagneticModel { class GEOGRAPHICLIB_EXPORT MagneticModel {
private: private:
typedef Math::real real; typedef Math::real real;
static const int idlength_ = 8; static const int idlength_ = 8;
std::string _name, _dir, _description, _date, _filename, _id; std::string _name, _dir, _description, _date, _filename, _id;
real _t0, _dt0, _tmin, _tmax, _a, _hmin, _hmax; real _t0, _dt0, _tmin, _tmax, _a, _hmin, _hmax;
int _Nmodels; int _Nmodels, _Nconstants;
SphericalHarmonic::normalization _norm; SphericalHarmonic::normalization _norm;
Geocentric _earth; Geocentric _earth;
std::vector< std::vector<real> > _G; std::vector< std::vector<real> > _G;
std::vector< std::vector<real> > _H; std::vector< std::vector<real> > _H;
std::vector<SphericalHarmonic> _harm; std::vector<SphericalHarmonic> _harm;
void Field(real t, real lat, real lon, real h, bool diffp, void Field(real t, real lat, real lon, real h, bool diffp,
real& Bx, real& By, real& Bz, real& Bx, real& By, real& Bz,
real& Bxt, real& Byt, real& Bzt) const; real& Bxt, real& Byt, real& Bzt) const;
void ReadMetadata(const std::string& name); void ReadMetadata(const std::string& name);
MagneticModel(const MagneticModel&); // copy constructor not allowed MagneticModel(const MagneticModel&); // copy constructor not allowed
 End of changes. 3 change blocks. 
7 lines changed or deleted 7 lines changed or added


 Math.hpp   Math.hpp 
skipping to change at line 375 skipping to change at line 375
} }
/** /**
* Fused multiply and add. * Fused multiply and add.
* *
* @tparam T the type of the arguments and the returned value. * @tparam T the type of the arguments and the returned value.
* @param[in] x * @param[in] x
* @param[in] y * @param[in] y
* @param[in] z * @param[in] z
* @return <i>xy</i> + <i>z</i>, correctly rounded (on those platforms with * @return <i>xy</i> + <i>z</i>, correctly rounded (on those platforms with
* support for the fma instruction). * support for the <code>fma</code> instruction).
********************************************************************** / ********************************************************************** /
template<typename T> static inline T fma(T x, T y, T z) { template<typename T> static inline T fma(T x, T y, T z) {
#if GEOGRAPHICLIB_CXX11_MATH #if GEOGRAPHICLIB_CXX11_MATH
using std::fma; return fma(x, y, z); using std::fma; return fma(x, y, z);
#else #else
return x * y + z; return x * y + z;
#endif #endif
} }
/** /**
skipping to change at line 420 skipping to change at line 420
GEOGRAPHICLIB_VOLATILE T vpp = s - up; GEOGRAPHICLIB_VOLATILE T vpp = s - up;
up -= u; up -= u;
vpp -= v; vpp -= v;
t = -(up + vpp); t = -(up + vpp);
// u + v = s + t // u + v = s + t
// = round(u + v) + t // = round(u + v) + t
return s; return s;
} }
/** /**
* Evaluate a polynomial.
*
* @tparam T the type of the arguments and returned value.
* @param[in] N the order of the polynomial.
* @param[in] p the coefficient array (of size \e N + 1).
* @param[in] x the variable.
* @return the value of the polynomial.
*
* Evaluate <i>y</i> = &sum;<sub><i>n</i>=0..<i>N</i></sub>
* <i>p</i><sub><i>n</i></sub> <i>x</i><sup><i>N</i>&minus;<i>n</i></su
p>.
* Return 0 if \e N &lt; 0. Return <i>p</i><sub>0</sub>, if \e N = 0 (
even
* if \e x is infinite or a nan). The evaluation uses Horner's method.
**********************************************************************
/
template<typename T> static inline T polyval(int N, const T p[], T x)
{ T y = N < 0 ? 0 : *p++; while (--N >= 0) y = y * x + *p++; return y;
}
/**
* 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;, 180&deg;). * @return the angle reduced to the range [&minus;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) template<typename T> static inline T AngNormalize(T x)
{ return x >= 180 ? x - 360 : (x < -180 ? x + 360 : x); } { return x >= 180 ? x - 360 : (x < -180 ? x + 360 : x); }
skipping to change at line 479 skipping to change at line 496
* *
* @tparam T the type of the argument and returned value. * @tparam T the type of the argument and returned value.
* @param[in] x * @param[in] x
* @return the coarsened value. * @return the coarsened value.
* *
* The makes the smallest gap in \e x = 1/16 - nextafter(1/16, 0) = * The makes the smallest gap in \e x = 1/16 - nextafter(1/16, 0) =
* 1/2<sup>57</sup> for reals = 0.7 pm on the earth if \e x is an angle in * 1/2<sup>57</sup> for reals = 0.7 pm on the earth if \e x is an angle in
* degrees. (This is about 1000 times more resolution than we get with * degrees. (This is about 1000 times more resolution than we get with
* angles around 90&deg;.) We use this to avoid having to deal with ne ar * angles around 90&deg;.) We use this to avoid having to deal with ne ar
* singular cases when \e x is non-zero but tiny (e.g., * singular cases when \e x is non-zero but tiny (e.g.,
* 10<sup>&minus;200</sup>). * 10<sup>&minus;200</sup>). This also converts -0 to +0.
********************************************************************** / ********************************************************************** /
template<typename T> static inline T AngRound(T x) { template<typename T> static inline T AngRound(T x) {
using std::abs; using std::abs;
const T z = 1/T(16); const T z = 1/T(16);
GEOGRAPHICLIB_VOLATILE T y = abs(x); GEOGRAPHICLIB_VOLATILE T y = 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 ? 0 - y : y;
} }
/** /**
* Evaluate the tangent function with the argument in degrees * Evaluate the tangent function with the argument in degrees
* *
* @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 in degrees. * @param[in] x in degrees.
* @return tan(<i>x</i>). * @return tan(<i>x</i>).
* *
* If \e x = &plusmn;90&deg;, then a suitably large (but finite) value is * If \e x = &plusmn;90&deg;, then a suitably large (but finite) value is
skipping to change at line 536 skipping to change at line 553
* *
* @tparam T the type of the arguments and the returned value. * @tparam T the type of the arguments and the returned value.
* @param[in] y * @param[in] y
* @param[in] x * @param[in] x
* @return atan2(<i>y</i>, <i>x</i>) in degrees. * @return atan2(<i>y</i>, <i>x</i>) in degrees.
* *
* The result is in the range [&minus;180&deg; 180&deg;). * The result is in the range [&minus;180&deg; 180&deg;).
********************************************************************** / ********************************************************************** /
template<typename T> static inline T atan2d(T y, T x) { template<typename T> static inline T atan2d(T y, T x) {
using std::atan2; using std::atan2;
// The "0 -" converts -0 to +0.
return 0 - atan2(-y, x) / Math::degree(); return 0 - atan2(-y, x) / Math::degree();
} }
/** /**
* Evaluate <i>e</i> atanh(<i>e x</i>) * Evaluate <i>e</i> atanh(<i>e x</i>)
* *
* @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
* @param[in] es the signed eccentricity = sign(<i>e</i><sup>2</sup>) * @param[in] es the signed eccentricity = sign(<i>e</i><sup>2</sup>)
* sqrt(|<i>e</i><sup>2</sup>|) * sqrt(|<i>e</i><sup>2</sup>|)
 End of changes. 5 change blocks. 
3 lines changed or deleted 25 lines changed or added


 PolygonArea.hpp   PolygonArea.hpp 
skipping to change at line 114 skipping to change at line 114
* @param[in] earth the Geodesic object to use for geodesic calculation s. * @param[in] earth the Geodesic object to use for geodesic calculation s.
* @param[in] polyline if true that treat the points as defining a poly line * @param[in] polyline if true that treat the points as defining a poly line
* instead of a polygon (default = false). * instead of a polygon (default = false).
********************************************************************** / ********************************************************************** /
PolygonAreaT(const GeodType& earth, bool polyline = false) PolygonAreaT(const GeodType& earth, bool polyline = false)
: _earth(earth) : _earth(earth)
, _area0(_earth.EllipsoidArea()) , _area0(_earth.EllipsoidArea())
, _polyline(polyline) , _polyline(polyline)
, _mask(GeodType::LATITUDE | GeodType::LONGITUDE | GeodType::DISTANCE | , _mask(GeodType::LATITUDE | GeodType::LONGITUDE | GeodType::DISTANCE |
(_polyline ? GeodType::NONE : (_polyline ? GeodType::NONE :
GeodType::AREA | GeodType::LONG_NOWRAP)) GeodType::AREA | GeodType::LONG_UNROLL))
{ Clear(); } { Clear(); }
/** /**
* Clear PolygonAreaT, allowing a new polygon to be started. * Clear PolygonAreaT, allowing a new polygon to be started.
********************************************************************** / ********************************************************************** /
void Clear() { void Clear() {
_num = 0; _num = 0;
_crossings = 0; _crossings = 0;
_areasum = 0; _areasum = 0;
_perimetersum = 0; _perimetersum = 0;
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 Rhumb.hpp   Rhumb.hpp 
skipping to change at line 221 skipping to change at line 221
* Calculate distance \e s12. * Calculate distance \e s12.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
DISTANCE = 1U<<10, DISTANCE = 1U<<10,
/** /**
* Calculate area \e S12. * Calculate area \e S12.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
AREA = 1U<<14, AREA = 1U<<14,
/** /**
* Do not wrap the \e lon2 in the direct calculation. * Unroll \e lon2 in the direct calculation. (This flag used to be
* called LONG_NOWRAP.)
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
LONG_NOWRAP = 1U<<15, LONG_UNROLL = 1U<<15,
/// \cond SKIP
LONG_NOWRAP = LONG_UNROLL,
/// \endcond
/** /**
* Calculate everything. (LONG_NOWRAP is not included in this mask.) * Calculate everything. (LONG_UNROLL is not included in this mask.)
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
ALL = 0x7F80U, ALL = 0x7F80U,
}; };
/** /**
* Constructor for a ellipsoid with * Constructor for a ellipsoid with
* *
* @param[in] a equatorial radius (meters). * @param[in] a equatorial radius (meters).
* @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphe re. * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphe re.
skipping to change at line 307 skipping to change at line 311
* 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] S12 area under the rhumb line (meters<sup>2</sup>). * @param[out] S12 area under the rhumb line (meters<sup>2</sup>).
* *
* The Rhumb::mask values possible for \e outmask are * The Rhumb::mask values possible for \e outmask are
* - \e outmask |= Rhumb::LATITUDE for the latitude \e lat2; * - \e outmask |= Rhumb::LATITUDE for the latitude \e lat2;
* - \e outmask |= Rhumb::LONGITUDE for the latitude \e lon2; * - \e outmask |= Rhumb::LONGITUDE for the latitude \e lon2;
* - \e outmask |= Rhumb::AREA for the area \e S12; * - \e outmask |= Rhumb::AREA for the area \e S12;
* - \e outmask |= Rhumb::ALL for all of the above; * - \e outmask |= Rhumb::ALL for all of the above;
* - \e outmask |= Rhumb::LONG_NOWRAP stops the returned value of \e * - \e outmask |= Rhumb::LONG_UNROLL to unroll \e lon2 instead of wrap
* lon2 being wrapped into the range [&minus;180&deg;, 180&deg;). ping
* it into the range [&minus;180&deg;, 180&deg;).
* . * .
* With the LONG_NOWRAP bit set, the quantity \e lon2 &minus; \e lon1 * With the Rhumb::LONG_UNROLL bit set, the quantity \e lon2 &minus;
* indicates how many times the rhumb line wrapped around the ellipsoid * \e lon1 indicates how many times and in what sense the rhumb line
. * encircles the ellipsoid. Because \e lon2 might be outside the norma
* Because \e lon2 might be outside the normal allowed range for l
* longitudes, [&minus;540&deg;, 540&deg;), be sure to normalize it wit * allowed range for longitudes, [&minus;540&deg;, 540&deg;), be sure t
h o
* Math::AngNormalize2 before using it in other GeographicLib calls. * normalize it with Math::AngNormalize2 before using it in other
* GeographicLib calls.
********************************************************************** / ********************************************************************** /
void GenDirect(real lat1, real lon1, real azi12, real s12, unsigned out mask, void GenDirect(real lat1, real lon1, real azi12, real s12, unsigned out mask,
real& lat2, real& lon2, real& S12) const; real& lat2, real& lon2, real& S12) const;
/** /**
* Solve the inverse rhumb problem returning also the area. * Solve the inverse rhumb problem returning also the area.
* *
* @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).
skipping to change at line 454 skipping to change at line 459
typedef Math::real real; typedef Math::real real;
friend class Rhumb; friend class Rhumb;
const Rhumb& _rh; const Rhumb& _rh;
bool _exact; bool _exact;
real _lat1, _lon1, _azi12, _salp, _calp, _mu1, _psi1, _r1; real _lat1, _lon1, _azi12, _salp, _calp, _mu1, _psi1, _r1;
RhumbLine& operator=(const RhumbLine&); // copy assignment not allowed RhumbLine& operator=(const RhumbLine&); // copy assignment not allowed
RhumbLine(const Rhumb& rh, real lat1, real lon1, real azi12, RhumbLine(const Rhumb& rh, real lat1, real lon1, real azi12,
bool exact); bool exact);
public: public:
/**
* This is a duplication of Rhumb::mask.
**********************************************************************
/
enum mask { enum mask {
/** /**
* No output. * No output.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
NONE = Rhumb::NONE, NONE = Rhumb::NONE,
/** /**
* Calculate latitude \e lat2. * Calculate latitude \e lat2.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
skipping to change at line 486 skipping to change at line 494
* Calculate distance \e s12. * Calculate distance \e s12.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
DISTANCE = Rhumb::DISTANCE, DISTANCE = Rhumb::DISTANCE,
/** /**
* Calculate area \e S12. * Calculate area \e S12.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
AREA = Rhumb::AREA, AREA = Rhumb::AREA,
/** /**
* Do wrap the \e lon2 in the direct calculation. * Unroll \e lon2 in the direct calculation. (This flag used to be
* called LONG_NOWRAP.)
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
LONG_NOWRAP = Rhumb::LONG_NOWRAP, LONG_UNROLL = Rhumb::LONG_UNROLL,
/// \cond SKIP
LONG_NOWRAP = LONG_UNROLL,
/// \endcond
/** /**
* Calculate everything. (LONG_NOWRAP is not included in this mask.) * Calculate everything. (LONG_UNROLL is not included in this mask.)
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
ALL = Rhumb::ALL, ALL = Rhumb::ALL,
}; };
/** /**
* Compute the position of point 2 which is a distance \e s12 (meters) from * Compute the position of point 2 which is a distance \e s12 (meters) from
* point 1. The area is also computed. * point 1. The area is also computed.
* *
* @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
skipping to change at line 533 skipping to change at line 545
real t; real t;
GenPosition(s12, LATITUDE | LONGITUDE, lat2, lon2, t); GenPosition(s12, LATITUDE | LONGITUDE, lat2, lon2, t);
} }
/** /**
* The general position routine. RhumbLine::Position is defined in ter m so * The general position routine. RhumbLine::Position is defined in ter m so
* this function. * this function.
* *
* @param[in] s12 distance between point 1 and point 2 (meters); it can be * @param[in] s12 distance between point 1 and point 2 (meters); it can be
* negative. * negative.
* @param[in] outmask a bitor'ed combination of Rhumb::mask values * @param[in] outmask a bitor'ed combination of RhumbLine::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] S12 area under the rhumb line (meters<sup>2</sup>). * @param[out] S12 area under the rhumb line (meters<sup>2</sup>).
* *
* The Rhumb::mask values possible for \e outmask are * The RhumbLine::mask values possible for \e outmask are
* - \e outmask |= Rhumb::LATITUDE for the latitude \e lat2; * - \e outmask |= RhumbLine::LATITUDE for the latitude \e lat2;
* - \e outmask |= Rhumb::LONGITUDE for the latitude \e lon2; * - \e outmask |= RhumbLine::LONGITUDE for the latitude \e lon2;
* - \e outmask |= Rhumb::AREA for the area \e S12; * - \e outmask |= RhumbLine::AREA for the area \e S12;
* - \e outmask |= Rhumb::ALL for all of the above; * - \e outmask |= RhumbLine::ALL for all of the above;
* - \e outmask |= Rhumb::LONG_NOWRAP stops the returned value of \e * - \e outmask |= RhumbLine::LONG_UNROLL to unroll \e lon2 instead of
* lon2 being wrapped into the range [&minus;180&deg;, 180&deg;). * wrapping it into the range [&minus;180&deg;, 180&deg;).
* . * .
* With the LONG_NOWRAP bit set, the quantity \e lon2 &minus; \e lon1 * With the RhumbLine::LONG_UNROLL bit set, the quantity \e lon2 &minus
* indicates how many times the rhumb line wrapped around the ellipsoid ; \e
. * lon1 indicates how many times and in what sense the rhumb line encir
* Because \e lon2 might be outside the normal allowed range for cles
* longitudes, [&minus;540&deg;, 540&deg;), be sure to normalize it wit * the ellipsoid. Because \e lon2 might be outside the normal allowed
h * range for longitudes, [&minus;540&deg;, 540&deg;), be sure to normal
* Math::AngNormalize2 before using it in other GeographicLib calls. ize
* it with Math::AngNormalize2 before using it in other GeographicLib
* calls.
* *
* If \e s12 is large enough that the rhumb line crosses a pole, the * If \e s12 is large enough that the rhumb line crosses a pole, the
* longitude of point 2 is indeterminate (a NaN is returned for \e lon2 and * longitude of point 2 is indeterminate (a NaN is returned for \e lon2 and
* \e S12). * \e S12).
********************************************************************** / ********************************************************************** /
void GenPosition(real s12, unsigned outmask, void GenPosition(real s12, unsigned outmask,
real& lat2, real& lon2, real& S12) const; real& lat2, real& lon2, real& S12) const;
/** \name Inspector functions /** \name Inspector functions
********************************************************************** / ********************************************************************** /
 End of changes. 12 change blocks. 
30 lines changed or deleted 46 lines changed or added


 SphericalHarmonic.hpp   SphericalHarmonic.hpp 
skipping to change at line 17 skipping to change at line 17
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_SPHERICALHARMONIC_HPP) #if !defined(GEOGRAPHICLIB_SPHERICALHARMONIC_HPP)
#define GEOGRAPHICLIB_SPHERICALHARMONIC_HPP 1 #define GEOGRAPHICLIB_SPHERICALHARMONIC_HPP 1
#include <vector> #include <vector>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/SphericalEngine.hpp> #include <GeographicLib/SphericalEngine.hpp>
#include <GeographicLib/CircularEngine.hpp> #include <GeographicLib/CircularEngine.hpp>
#include <GeographicLib/Geocentric.hpp>
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief Spherical harmonic series * \brief Spherical harmonic series
* *
* This class evaluates the spherical harmonic sum \verbatim * This class evaluates the spherical harmonic sum \verbatim
V(x, y, z) = sum(n = 0..N)[ q^(n+1) * sum(m = 0..n)[ V(x, y, z) = sum(n = 0..N)[ q^(n+1) * sum(m = 0..n)[
(C[n,m] * cos(m*lambda) + S[n,m] * sin(m*lambda)) * (C[n,m] * cos(m*lambda) + S[n,m] * sin(m*lambda)) *
P[n,m](cos(theta)) ] ] P[n,m](cos(theta)) ] ]
skipping to change at line 138 skipping to change at line 137
public: public:
/** /**
* Constructor with a full set of coefficients specified. * Constructor with a full set of coefficients specified.
* *
* @param[in] C the coefficients <i>C</i><sub><i>nm</i></sub>. * @param[in] C the coefficients <i>C</i><sub><i>nm</i></sub>.
* @param[in] S the coefficients <i>S</i><sub><i>nm</i></sub>. * @param[in] S the coefficients <i>S</i><sub><i>nm</i></sub>.
* @param[in] N the maximum degree and order of the sum * @param[in] N the maximum degree and order of the sum
* @param[in] a the reference radius appearing in the definition of the * @param[in] a the reference radius appearing in the definition of the
* sum. * sum.
* @param[in] norm the normalization for the associated Legendre * @param[in] norm the normalization for the associated Legendre
* polynomials, either SphericalHarmonic::full (the default) or * polynomials, either SphericalHarmonic::FULL (the default) or
* SphericalHarmonic::schmidt. * SphericalHarmonic::SCHMIDT.
* @exception GeographicErr if \e N does not satisfy \e N &ge; &minus;1 . * @exception GeographicErr if \e N does not satisfy \e N &ge; &minus;1 .
* @exception GeographicErr if \e C or \e S is not big enough to hold t he * @exception GeographicErr if \e C or \e S is not big enough to hold t he
* coefficients. * coefficients.
* *
* The coefficients <i>C</i><sub><i>nm</i></sub> and * The coefficients <i>C</i><sub><i>nm</i></sub> and
* <i>S</i><sub><i>nm</i></sub> are stored in the one-dimensional vecto rs * <i>S</i><sub><i>nm</i></sub> are stored in the one-dimensional vecto rs
* \e C and \e S which must contain (\e N + 1)(\e N + 2)/2 and \e N (\e N + * \e C and \e S which must contain (\e N + 1)(\e N + 2)/2 and \e N (\e N +
* 1)/2 elements, respectively, stored in "column-major" order. Thus f or * 1)/2 elements, respectively, stored in "column-major" order. Thus f or
* \e N = 3, the order would be: * \e N = 3, the order would be:
* <i>C</i><sub>00</sub>, * <i>C</i><sub>00</sub>,
skipping to change at line 288 skipping to change at line 287
* *
* @param[in] p the radius of the circle. * @param[in] p the radius of the circle.
* @param[in] z the height of the circle above the equatorial plane. * @param[in] z the height of the circle above the equatorial plane.
* @param[in] gradp if true the returned object will be able to compute the * @param[in] gradp if true the returned object will be able to compute the
* gradient of the sum. * gradient of the sum.
* @exception std::bad_alloc if the memory for the CircularEngine can't be * @exception std::bad_alloc if the memory for the CircularEngine can't be
* allocated. * allocated.
* @return the CircularEngine object. * @return the CircularEngine object.
* *
* SphericalHarmonic::operator()() exchanges the order of the sums in t he * SphericalHarmonic::operator()() exchanges the order of the sums in t he
* definition, i.e., &sum;<sub>n = 0..N</sub> &sum;<sub>m = 0..n</sub> * definition, i.e., &sum;<sub><i>n</i> = 0..<i>N</i></sub>
* becomes &sum;<sub>m = 0..N</sub> &sum;<sub>n = m..N</sub>. * &sum;<sub><i>m</i> = 0..<i>n</i></sub> becomes &sum;<sub><i>m</i> =
* 0..<i>N</i></sub> &sum;<sub><i>n</i> = <i>m</i>..<i>N</i></sub>.
* SphericalHarmonic::Circle performs the inner sum over degree \e n (w hich * SphericalHarmonic::Circle performs the inner sum over degree \e n (w hich
* entails about <i>N</i><sup>2</sup> operations). Calling * entails about <i>N</i><sup>2</sup> operations). Calling
* CircularEngine::operator()() on the returned object performs the out er * CircularEngine::operator()() on the returned object performs the out er
* sum over the order \e m (about \e N operations). * sum over the order \e m (about \e N operations).
* *
* Here's an example of computing the spherical sum at a sequence of * Here's an example of computing the spherical sum at a sequence of
* longitudes without using a CircularEngine object \code * longitudes without using a CircularEngine object \code
SphericalHarmonic h(...); // Create the SphericalHarmonic object SphericalHarmonic h(...); // Create the SphericalHarmonic object
double r = 2, lat = 33, lon0 = 44, dlon = 0.01; double r = 2, lat = 33, lon0 = 44, dlon = 0.01;
double double
 End of changes. 3 change blocks. 
5 lines changed or deleted 5 lines changed or added


 SphericalHarmonic1.hpp   SphericalHarmonic1.hpp 
skipping to change at line 241 skipping to change at line 241
* @param[in] tau the multiplier for the correction coefficients. * @param[in] tau the multiplier for the correction coefficients.
* @param[in] p the radius of the circle. * @param[in] p the radius of the circle.
* @param[in] z the height of the circle above the equatorial plane. * @param[in] z the height of the circle above the equatorial plane.
* @param[in] gradp if true the returned object will be able to compute the * @param[in] gradp if true the returned object will be able to compute the
* gradient of the sum. * gradient of the sum.
* @exception std::bad_alloc if the memory for the CircularEngine can't be * @exception std::bad_alloc if the memory for the CircularEngine can't be
* allocated. * allocated.
* @return the CircularEngine object. * @return the CircularEngine object.
* *
* SphericalHarmonic1::operator()() exchanges the order of the sums in the * SphericalHarmonic1::operator()() exchanges the order of the sums in the
* definition, i.e., &sum;<sub>n = 0..N</sub> &sum;<sub>m = 0..n</sub> * definition, i.e., &sum;<sub><i>n</i> = 0..<i>N</i></sub>
* becomes &sum;<sub>m = 0..N</sub> &sum;<sub>n = m..N</sub>. * &sum;<sub><i>m</i> = 0..<i>n</i></sub> becomes &sum;<sub><i>m</i> =
* 0..<i>N</i></sub> &sum;<sub><i>n</i> = <i>m</i>..<i>N</i></sub>.
* SphericalHarmonic1::Circle performs the inner sum over degree \e n * SphericalHarmonic1::Circle performs the inner sum over degree \e n
* (which entails about <i>N</i><sup>2</sup> operations). Calling * (which entails about <i>N</i><sup>2</sup> operations). Calling
* CircularEngine::operator()() on the returned object performs the out er * CircularEngine::operator()() on the returned object performs the out er
* sum over the order \e m (about \e N operations). * sum over the order \e m (about \e N operations).
* *
* See SphericalHarmonic::Circle for an example of its use. * See SphericalHarmonic::Circle for an example of its use.
********************************************************************** / ********************************************************************** /
CircularEngine Circle(real tau, real p, real z, bool gradp) const { CircularEngine Circle(real tau, real p, real z, bool gradp) const {
real f[] = {1, tau}; real f[] = {1, tau};
switch (_norm) { switch (_norm) {
 End of changes. 1 change blocks. 
2 lines changed or deleted 3 lines changed or added


 SphericalHarmonic2.hpp   SphericalHarmonic2.hpp 
skipping to change at line 269 skipping to change at line 269
* @param[in] tau2 multiplier for correction coefficients \e C'' and \e S''. * @param[in] tau2 multiplier for correction coefficients \e C'' and \e S''.
* @param[in] p the radius of the circle. * @param[in] p the radius of the circle.
* @param[in] z the height of the circle above the equatorial plane. * @param[in] z the height of the circle above the equatorial plane.
* @param[in] gradp if true the returned object will be able to compute the * @param[in] gradp if true the returned object will be able to compute the
* gradient of the sum. * gradient of the sum.
* @exception std::bad_alloc if the memory for the CircularEngine can't be * @exception std::bad_alloc if the memory for the CircularEngine can't be
* allocated. * allocated.
* @return the CircularEngine object. * @return the CircularEngine object.
* *
* SphericalHarmonic2::operator()() exchanges the order of the sums in the * SphericalHarmonic2::operator()() exchanges the order of the sums in the
* definition, i.e., &sum;<sub>n = 0..N</sub> &sum;<sub>m = 0..n</sub> * definition, i.e., &sum;<sub><i>n</i> = 0..<i>N</i></sub>
* becomes &sum;<sub>m = 0..N</sub> &sum;<sub>n = m..N</sub>.. * &sum;<sub><i>m</i> = 0..<i>n</i></sub> becomes &sum;<sub><i>m</i> =
* 0..<i>N</i></sub> &sum;<sub><i>n</i> = <i>m</i>..<i>N</i></sub>..
* SphericalHarmonic2::Circle performs the inner sum over degree \e n * SphericalHarmonic2::Circle performs the inner sum over degree \e n
* (which entails about <i>N</i><sup>2</sup> operations). Calling * (which entails about <i>N</i><sup>2</sup> operations). Calling
* CircularEngine::operator()() on the returned object performs the out er * CircularEngine::operator()() on the returned object performs the out er
* sum over the order \e m (about \e N operations). * sum over the order \e m (about \e N operations).
* *
* See SphericalHarmonic::Circle for an example of its use. * See SphericalHarmonic::Circle for an example of its use.
********************************************************************** / ********************************************************************** /
CircularEngine Circle(real tau1, real tau2, real p, real z, bool gradp) CircularEngine Circle(real tau1, real tau2, real p, real z, bool gradp)
const { const {
real f[] = {1, tau1, tau2}; real f[] = {1, tau1, tau2};
 End of changes. 1 change blocks. 
2 lines changed or deleted 3 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/