Accumulator.hpp   Accumulator.hpp 
skipping to change at line 42 skipping to change at line 42
* *
* 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.
* *
* Example of use: * Example of use:
* \include example-Accumulator.cpp * \include example-Accumulator.cpp
**********************************************************************/ **********************************************************************/
template<typename T = Math::real> template<typename T = Math::real>
class GEOGRAPHIC_EXPORT Accumulator { class GEOGRAPHIC_EXPORT Accumulator {
private: private:
// _s + _t accumulates for the sum. // _s + _t accumulators for the sum.
T _s, _t; T _s, _t;
// Same as Math::sum, but requires abs(u) >= abs(v). This isn't curren tly // Same as Math::sum, but requires abs(u) >= abs(v). This isn't curren tly
// used. // used.
static inline T fastsum(T u, T v, T& t) throw() { static inline T fastsum(T u, T v, T& t) throw() {
volatile T s = u + v; volatile T s = u + v;
volatile T vp = s - u; volatile T vp = s - u;
t = v - vp; t = v - vp;
return s; return s;
} }
void Add(T y) throw() { void Add(T y) throw() {
 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
// only negative for very prolate ellipsoids (_b/_a >= sqrt(2)) and we // only negative for very prolate ellipsoids (_b/_a >= sqrt(2)) and we
// still need to return a positive result in this case; hence the n eed // still need to return a positive result in this case; hence the n eed
// for the call to atan2. // for the call to atan2.
(_f < 0 ? (std::atan2(_e * std::abs(x), x < 0 ? -1 : 1)/_e) : x); (_f < 0 ? (std::atan2(_e * std::abs(x), x < 0 ? -1 : 1)/_e) : x);
} }
// 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) throw(); static real atanhxm1(real x) throw();
// 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: W. M. Kahan and R. J. Fateman, // See:
// Symbolic computation of divided differences, // W. M. Kahan and R. J. Fateman,
// SIGSAM Bull. 33(3), 7-28 (1999) // Symbolic computation of divided differences,
// http://doi.acm.org/10.1145/334714.334716 // SIGSAM Bull. 33(3), 7-28 (1999)
// http://www.cs.berkeley.edu/~fateman/papers/divdiff.pdf // http://dx.doi.org/10.1145/334714.334716
// 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)+g(y))/2 + Dg(x,y)*(f(x)+f(y))/2 // 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(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))
static inline real Dsn(real x, real y, real sx, real sy) throw() { static inline real Dsn(real x, real y, real sx, real sy) throw() {
// sx = x/hyp(x) // sx = x/hyp(x)
real t = x * y; real t = x * y;
return t > 0 ? (x + y) * Math::sq( (sx * sy)/t ) / (sx + sy) : return t > 0 ? (x + y) * Math::sq( (sx * sy)/t ) / (sx + sy) :
(x - y != 0 ? (sx - sy) / (x - y) : 1); (x - y != 0 ? (sx - sy) / (x - y) : 1);
} }
// Datanhee(x,y) = atanhee((x-y)/(1-e^2*x*y))/(x-y) // Datanhee(x,y) = atanhee((x-y)/(1-e^2*x*y))/(x-y)
inline real Datanhee(real x, real y) const throw() { inline real Datanhee(real x, real y) const throw() {
 End of changes. 2 change blocks. 
6 lines changed or deleted 9 lines changed or added


 Config.h   Config.h 
#define GEOGRAPHICLIB_VERSION_MAJOR 1
#define GEOGRAPHICLIB_VERSION_MINOR 31
#define GEOGRAPHICLIB_VERSION_PATCH 0
#define HAVE_LONG_DOUBLE 1 #define HAVE_LONG_DOUBLE 1
#define GEOGRAPHICLIB_VERSION_STRING "1.30" #define GEOGRAPHICLIB_VERSION_STRING "1.31"
/* # undef WORDS_BIGENDIAN */ /* # undef WORDS_BIGENDIAN */
 End of changes. 2 change blocks. 
1 lines changed or deleted 4 lines changed or added


 Constants.hpp   Constants.hpp 
skipping to change at line 130 skipping to change at line 130
/** /**
* <b>DEPRECATED</b> * <b>DEPRECATED</b>
* @return the reciprocal flattening of WGS84 ellipsoid. * @return the reciprocal flattening of WGS84 ellipsoid.
********************************************************************** / ********************************************************************** /
template<typename T> static inline T WGS84_r() throw() template<typename T> static inline T WGS84_r() throw()
{ return 1/WGS84_f<T>(); } { return 1/WGS84_f<T>(); }
/** /**
* <b>DEPRECATED</b> * <b>DEPRECATED</b>
* A synonym for WGS84_r<real>(). * A synonym for WGS84_r<real>().
********************************************************************** / ********************************************************************** /
/// \endcond
static inline Math::real WGS84_r() throw() { return WGS84_r<real>(); } static inline Math::real WGS84_r() throw() { return WGS84_r<real>(); }
/// \endcond
/** /**
* @tparam T the type of the returned value. * @tparam T the type of the returned value.
* @return the equatorial radius of GRS80 ellipsoid, \e a, in m. * @return the equatorial radius of GRS80 ellipsoid, \e a, in m.
********************************************************************** / ********************************************************************** /
template<typename T> static inline T GRS80_a() throw() template<typename T> static inline T GRS80_a() throw()
{ return T(6378137); } { return T(6378137); }
/** /**
* @tparam T the type of the returned value. * @tparam T the type of the returned value.
* @return the gravitational constant of the GRS80 ellipsoid, \e GM, in * @return the gravitational constant of the GRS80 ellipsoid, \e GM, in
* m<sup>3</sup> s<sup>&minus;2</sup>. * m<sup>3</sup> s<sup>&minus;2</sup>.
skipping to change at line 311 skipping to change at line 311
* Example of use: * Example of use:
* \include example-GeographicErr.cpp * \include example-GeographicErr.cpp
**********************************************************************/ **********************************************************************/
class GeographicErr : public std::runtime_error { class GeographicErr : public std::runtime_error {
public: public:
/** /**
* Constructor * Constructor
* *
* @param[in] msg a string message, which is accessible in the catch * @param[in] msg a string message, which is accessible in the catch
* clause, via what(). * clause via what().
********************************************************************** / ********************************************************************** /
GeographicErr(const std::string& msg) : std::runtime_error(msg) {} GeographicErr(const std::string& msg) : std::runtime_error(msg) {}
}; };
} // namespace GeographicLib } // namespace GeographicLib
#endif // GEOGRAPHICLIB_CONSTANTS_HPP #endif // GEOGRAPHICLIB_CONSTANTS_HPP
 End of changes. 3 change blocks. 
2 lines changed or deleted 2 lines changed or added


 DMS.hpp   DMS.hpp 
skipping to change at line 154 skipping to change at line 154
* - 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++
* implementation %GeographicLib is with 8-bit characters. The support for * implementation %GeographicLib is with 8-bit characters. The support for
* unicode symbols for degrees, minutes, and seconds is therefore via t he * unicode symbols for degrees, minutes, and seconds is therefore via t he
* <a href="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a> encoding. (T he * <a href="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a> encoding. (T he
* Javascript implementation of this class uses unicode natively, of * JavaScript implementation of this class uses unicode natively, of
* course.) * course.)
* *
* Here is the list of Unicode symbols supported for degrees, minutes, * Here is the list of Unicode symbols supported for degrees, minutes,
* seconds: * seconds:
* - degrees: * - degrees:
* - d, D lower and upper case letters * - d, D lower and upper case letters
* - U+00b0 degree symbol (&deg;) * - U+00b0 degree symbol (&deg;)
* - U+00ba masculine ordinal indicator * - U+00ba masculine ordinal indicator
* - U+2070 superscript zero * - U+2070 superscript zero
* - U+02da ring above * - U+02da ring above
skipping to change at line 307 skipping to change at line 307
* pad degrees to 2 digits, e.g., 08d03'S. * pad degrees to 2 digits, e.g., 08d03'S.
* - ind == DMS::LONGITUDE, trailing E or W hemisphere designator, no * - ind == DMS::LONGITUDE, trailing E or W hemisphere designator, no
* sign, pad degrees to 3 digits, e.g., 008d03'W. * sign, pad degrees to 3 digits, e.g., 008d03'W.
* - ind == DMS::AZIMUTH, convert to the range [0, 360&deg;), no * - ind == DMS::AZIMUTH, convert to the range [0, 360&deg;), no
* sign, pad degrees to 3 digits, , e.g., 351d57'. * sign, pad degrees to 3 digits, , e.g., 351d57'.
* . * .
* The integer parts of the minutes and seconds components are always g iven * The integer parts of the minutes and seconds components are always g iven
* with 2 digits. * with 2 digits.
********************************************************************** / ********************************************************************** /
static std::string Encode(real angle, component trailing, unsigned prec , static std::string Encode(real angle, component trailing, unsigned prec ,
flag ind, char dmssep); flag ind = NONE, char dmssep = char(0));
/**
* Convert angle (in degrees) into a DMS string (using d, ', and &quot;
).
*
* @param[in] angle input angle (degrees)
* @param[in] trailing DMS::component value indicating the trailing uni
ts
* on the string and this is given as a decimal number if necessary.
* @param[in] prec the number of digits after the decimal point for the
* trailing component.
* @param[in] ind DMS::flag value indicated additional formatting.
* @return formatted string
*
* <b>COMPATIBILITY NOTE:</b> This function calls
* Encode(real, component, unsigned, flag, char) with a 5th
* argument of char(0). At some point,
* Encode(real, component, unsigned, flag) and will be withdrawn
* and the interface to
* Encode(real, component, unsigned, flag, char) changed so that
* its 4th and 5th arguments have default values. This will
* preserve source-level compatibility.
**********************************************************************
/
static std::string Encode(real angle, component trailing, unsigned prec
,
flag ind = NONE);
/** /**
* Convert angle into a DMS string (using d, ', and &quot;) selecting t he * Convert angle into a DMS string (using d, ', and &quot;) selecting t he
* trailing component based on the precision. * trailing component based on the precision.
* *
* @param[in] angle input angle (degrees) * @param[in] angle input angle (degrees)
* @param[in] prec the precision relative to 1 degree. * @param[in] prec the precision relative to 1 degree.
* @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).
 End of changes. 2 change blocks. 
29 lines changed or deleted 2 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 ellip * <a href="http://dx.doi.org/10.1007/BF02198293"> Computation of real
tic or
* integrals</a>, Numerical Algorithms 10, 13--26 (1995) * complex elliptic integrals</a>, Numerical Algorithms 10, 13--26 (199
5)
* . * .
* with the additional optimizations given in http://dlmf.nist.gov/19.36. i. * with the additional optimizations given in http://dlmf.nist.gov/19.36. i.
* The computation of the Jacobi elliptic functions uses the algorithm gi ven * The computation of the Jacobi elliptic functions uses the algorithm gi ven
* in * in
* - R. Bulirsch, * - R. Bulirsch,
* <a href="http://dx.doi.org/10.1007/BF01397975"> Numerical Calculatio n of * <a href="http://dx.doi.org/10.1007/BF01397975"> Numerical Calculatio n of
* Elliptic Integrals and Elliptic Functions</a>, Numericshe Mathematik 7, * Elliptic Integrals and Elliptic Functions</a>, Numericshe Mathematik 7,
* 78--90 (1965). * 78--90 (1965).
* . * .
* The notation follows http://dlmf.nist.gov/19 and http://dlmf.nist.gov/ 22 * The notation follows http://dlmf.nist.gov/19 and http://dlmf.nist.gov/ 22
skipping to change at line 89 skipping to change at line 89
/** /**
* Constructor specifying the modulus and parameter. * Constructor specifying the modulus and parameter.
* *
* @param[in] k2 the square of the modulus <i>k</i><sup>2</sup>. * @param[in] k2 the square of the modulus <i>k</i><sup>2</sup>.
* <i>k</i><sup>2</sup> must lie in (-&infin;, 1). (No checking is * <i>k</i><sup>2</sup> must lie in (-&infin;, 1). (No checking is
* done.) * done.)
* @param[in] alpha2 the parameter &alpha;<sup>2</sup>. * @param[in] alpha2 the parameter &alpha;<sup>2</sup>.
* &alpha;<sup>2</sup> must lie in (-&infin;, 1). (No checking is do ne.) * &alpha;<sup>2</sup> must lie in (-&infin;, 1). (No checking is do ne.)
* *
* If only elliptic integrals of the first and second kinds are needed, * If only elliptic integrals of the first and second kinds are needed,
* then set &alpha;<sup>2</sup> = 0 (in which case we have &Pi;(&phi;, * then set &alpha;<sup>2</sup> = 0 (the default value); in this case,
0, we
* \e k) = \e F(&phi;, \e k), \e G(&phi;, 0, \e k) = \e E(&phi;, \e k)) * have &Pi;(&phi;, 0, \e k) = \e F(&phi;, \e k), \e G(&phi;, 0, \e k)
, = \e
* and \e H(&phi;, 0, \e k) = \e F(&phi;, \e k) - \e D(&phi;, \e k). * E(&phi;, \e k), and \e H(&phi;, 0, \e k) = \e F(&phi;, \e k) - \e
* D(&phi;, \e k).
********************************************************************** / ********************************************************************** /
EllipticFunction(real k2, real alpha2) throw(); EllipticFunction(real k2 = 0, real alpha2 = 0) throw();
/** /**
* Constructor specifying the modulus and parameter and their complemen ts. * Constructor specifying the modulus and parameter and their complemen ts.
* *
* @param[in] k2 the square of the modulus <i>k</i><sup>2</sup>. * @param[in] k2 the square of the modulus <i>k</i><sup>2</sup>.
* <i>k</i><sup>2</sup> must lie in (-&infin;, 1). (No checking is * <i>k</i><sup>2</sup> must lie in (-&infin;, 1). (No checking is
* done.) * done.)
* @param[in] alpha2 the parameter &alpha;<sup>2</sup>. * @param[in] alpha2 the parameter &alpha;<sup>2</sup>.
* &alpha;<sup>2</sup> must lie in (-&infin;, 1). (No checking is do ne.) * &alpha;<sup>2</sup> must lie in (-&infin;, 1). (No checking is do ne.)
* @param[in] kp2 the complementary modulus squared <i>k'</i><sup>2</su p> = * @param[in] kp2 the complementary modulus squared <i>k'</i><sup>2</su p> =
skipping to change at line 116 skipping to change at line 117
* &minus; &alpha;<sup>2</sup>. * &minus; &alpha;<sup>2</sup>.
* *
* The arguments must satisfy \e k2 + \e kp2 = 1 and \e alpha2 + \e alp hap2 * The arguments must satisfy \e k2 + \e kp2 = 1 and \e alpha2 + \e alp hap2
* = 1. (No checking is done that these conditions are met.) This * = 1. (No checking is done that these conditions are met.) This
* constructor is provided to enable accuracy to be maintained, e.g., w hen * constructor is provided to enable accuracy to be maintained, e.g., w hen
* \e k is very close to unity. * \e k is very close to unity.
********************************************************************** / ********************************************************************** /
EllipticFunction(real k2, real alpha2, real kp2, real alphap2) throw(); EllipticFunction(real k2, real alpha2, real kp2, real alphap2) throw();
/** /**
* Constructor specifying the modulus only.
*
* @param[in] k2 the square of the modulus <i>k</i><sup>2</sup>.
* <i>k</i><sup>2</sup> must lie in (-&infin;, 1). (No checking is
* done.)
*
* <b>COMPATIBILITY NOTE:</b> This constructor calls EllipticFunction(r
eal,
* real) with a 2nd argument of 0. At some point, EllipticFunction(rea
l)
* and will be withdrawn and the interface to EllipticFunction(real, re
al)
* changed so that its 2nd argument defaults to 0. This will preserve
* source-level compatibility.
**********************************************************************
/
explicit EllipticFunction(real k2 = 0) throw();
/**
* Reset the modulus and parameter. * Reset the modulus and parameter.
* *
* @param[in] k2 the new value of square of the modulus * @param[in] k2 the new value of square of the modulus
* <i>k</i><sup>2</sup> which must lie in (-&infin;, 1). (No checkin g is * <i>k</i><sup>2</sup> which must lie in (-&infin;, 1). (No checkin g is
* done.) * done.)
* @param[in] alpha2 the new value of parameter &alpha;<sup>2</sup>. * @param[in] alpha2 the new value of parameter &alpha;<sup>2</sup>.
* &alpha;<sup>2</sup> must lie in (-&infin;, 1). (No checking is do ne.) * &alpha;<sup>2</sup> must lie in (-&infin;, 1). (No checking is do ne.)
********************************************************************** / ********************************************************************** /
void Reset(real k2, real alpha2 = 0) throw() void Reset(real k2 = 0, real alpha2 = 0) throw()
{ Reset(k2, alpha2, 1 - k2, 1 - alpha2); } { Reset(k2, alpha2, 1 - k2, 1 - alpha2); }
/** /**
* Reset the modulus and parameter supplying also their complements. * Reset the modulus and parameter supplying also their complements.
* *
* @param[in] k2 the square of the modulus <i>k</i><sup>2</sup>. * @param[in] k2 the square of the modulus <i>k</i><sup>2</sup>.
* <i>k</i><sup>2</sup> must lie in (-&infin;, 1). (No checking is * <i>k</i><sup>2</sup> must lie in (-&infin;, 1). (No checking is
* done.) * done.)
* @param[in] alpha2 the parameter &alpha;<sup>2</sup>. * @param[in] alpha2 the parameter &alpha;<sup>2</sup>.
* &alpha;<sup>2</sup> must lie in (-&infin;, 1). (No checking is do ne.) * &alpha;<sup>2</sup> must lie in (-&infin;, 1). (No checking is do ne.)
skipping to change at line 188 skipping to change at line 174
/** /**
* @return the parameter &alpha;<sup>2</sup>. * @return the parameter &alpha;<sup>2</sup>.
********************************************************************** / ********************************************************************** /
Math::real alpha2() const throw() { return _alpha2; } Math::real alpha2() const throw() { return _alpha2; }
/** /**
* @return the complementary parameter &alpha;'<sup>2</sup> = 1 &minus; * @return the complementary parameter &alpha;'<sup>2</sup> = 1 &minus;
* &alpha;<sup>2</sup>. * &alpha;<sup>2</sup>.
********************************************************************** / ********************************************************************** /
Math::real alphap2() const throw() { return _alphap2; } Math::real alphap2() const throw() { return _alphap2; }
///@}
/// \cond SKIP
/** /**
* @return the square of the modulus <i>k</i><sup>2</sup>. * @return the square of the modulus <i>k</i><sup>2</sup>.
* *
* <b>DEPRECATED</b>, use k2() instead. * <b>DEPRECATED</b>, use k2() instead.
********************************************************************** / ********************************************************************** /
Math::real m() const throw() { return _k2; } Math::real m() const throw() { return _k2; }
/** /**
* @return the square of the complementary modulus <i>k'</i><sup>2</sup > = * @return the square of the complementary modulus <i>k'</i><sup>2</sup > =
* 1 &minus; <i>k</i><sup>2</sup>. * 1 &minus; <i>k</i><sup>2</sup>.
* *
* <b>DEPRECATED</b>, use kp2() instead. * <b>DEPRECATED</b>, use kp2() instead.
********************************************************************** / ********************************************************************** /
Math::real m1() const throw() { return _kp2; } Math::real m1() const throw() { return _kp2; }
///@} /// \endcond
/** \name Complete elliptic integrals. /** \name Complete elliptic integrals.
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* The complete integral of the first kind. * The complete integral of the first kind.
* *
* @return \e K(\e k). * @return \e K(\e k).
* *
* \e K(\e k) is defined in http://dlmf.nist.gov/19.2.E4 * \e K(\e k) is defined in http://dlmf.nist.gov/19.2.E4
 End of changes. 9 change blocks. 
31 lines changed or deleted 15 lines changed or added


 GeoCoords.hpp   GeoCoords.hpp 
skipping to change at line 417 skipping to change at line 417
* Precision specifies accuracy of representation as follows: * Precision specifies accuracy of representation as follows:
* - prec = &minus;5 (min), 1&deg; * - prec = &minus;5 (min), 1&deg;
* - prec = &minus;4, 0.1&deg; * - prec = &minus;4, 0.1&deg;
* - prec = &minus;3, 1' * - prec = &minus;3, 1'
* - prec = &minus;2, 0.1' * - prec = &minus;2, 0.1'
* - prec = &minus;1, 1&quot; * - prec = &minus;1, 1&quot;
* - prec = 0, 0.1&quot; (about 3m) * - prec = 0, 0.1&quot; (about 3m)
* - prec = 1, 0.01&quot; * - prec = 1, 0.01&quot;
* - prec = 10 (max), 10<sup>&minus;11</sup>&quot; * - prec = 10 (max), 10<sup>&minus;11</sup>&quot;
********************************************************************** / ********************************************************************** /
std::string DMSRepresentation(int prec, bool swaplatlong, char dmssep) std::string DMSRepresentation(int prec = 0, bool swaplatlong = false,
char dmssep = char(0))
const; const;
/** /**
* String representation with latitude and longitude as degrees, minute
s,
* seconds, and hemisphere.
*
* @param[in] prec precision (relative to about 1m)
* @param[in] swaplatlong if true give longitude first (default = false
)
* @exception std::bad_alloc if memory for the string can't be allocate
d.
* @return DMS latitude/longitude string representation.
*
* <b>COMPATIBILITY NOTE:</b> This function calls
* DMSRepresentation(int, bool, char) const with a 3rd argument of
* char(0). At some point, DMSRepresentation(int, bool) const and
* will be withdrawn and the interface to
* DMSRepresentation(int, bool, char) const changed so that its
* arguments have default values. This will preserve source-level
* compatibility.
**********************************************************************
/
std::string DMSRepresentation(int prec = 0, bool swaplatlong = false) c
onst;
/**
* MGRS string. * MGRS string.
* *
* @param[in] prec precision (relative to about 1m). * @param[in] prec precision (relative to about 1m).
* @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 MGRS string. * @return MGRS string.
* *
* This gives the coordinates of the enclosing grid square with size gi ven * This gives the coordinates of the enclosing grid square with size gi ven
* by the precision. Thus 38N 444180 3684790 converted to a MGRS * by the precision. Thus 38N 444180 3684790 converted to a MGRS
* coordinate at precision &minus;2 (100m) is 38SMB441847 and not * coordinate at precision &minus;2 (100m) is 38SMB441847 and not
* 38SMB442848. \e prec specifies the precision of the MGRS string as * 38SMB442848. \e prec specifies the precision of the MGRS string as
 End of changes. 2 change blocks. 
25 lines changed or deleted 2 lines changed or added


 Geodesic.hpp   Geodesic.hpp 
/** /**
* \file Geodesic.hpp * \file Geodesic.hpp
* \brief Header for GeographicLib::Geodesic class * \brief Header for GeographicLib::Geodesic class
* *
* Copyright (c) Charles Karney (2009-2012) <charles@karney.com> and licens ed * Copyright (c) Charles Karney (2009-2013) <charles@karney.com> and licens ed
* under the MIT/X11 License. For more information, see * under the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_GEODESIC_HPP) #if !defined(GEOGRAPHICLIB_GEODESIC_HPP)
#define GEOGRAPHICLIB_GEODESIC_HPP 1 #define GEOGRAPHICLIB_GEODESIC_HPP 1
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#if !defined(GEOGRAPHICLIB_GEODESIC_ORDER) #if !defined(GEOGRAPHICLIB_GEODESIC_ORDER)
skipping to change at line 55 skipping to change at line 55
* azi2, and \e s12. This is the \e inverse geodesic problem, whose solu tion * azi2, and \e s12. This is the \e inverse geodesic problem, whose solu tion
* is given by Geodesic::Inverse. Usually, the solution to the inverse * is given by Geodesic::Inverse. Usually, the solution to the inverse
* problem is unique. In cases where there are multiple solutions (all w ith * problem is unique. In cases where there are multiple solutions (all w ith
* the same \e s12, of course), all the solutions can be easily generated * the same \e s12, of course), all the solutions can be easily generated
* once a particular solution is provided. * once a particular solution is provided.
* *
* The standard way of specifying the direct problem is the specify the * The standard way of specifying the direct problem is the specify the
* distance \e s12 to the second point. However it is sometimes useful * distance \e s12 to the second point. However it is sometimes useful
* instead to specify the arc length \e a12 (in degrees) on the auxiliary * instead to specify the arc length \e a12 (in degrees) on the auxiliary
* sphere. This is a mathematical construct used in solving the geodesic * sphere. This is a mathematical construct used in solving the geodesic
* problems. The solution of the direct problem in this form is provide * problems. The solution of the direct problem in this form is provided
by by
* Geodesic::ArcDirect. An arc length in excess of 180&deg; indicates * Geodesic::ArcDirect. An arc length in excess of 180&deg; indicates th
* that the geodesic is not a shortest path. In addition, the arc length at
* between an equatorial crossing and the next extremum of latitude for a * the geodesic is not a shortest path. In addition, the arc length betw
* geodesic is 90&deg;. een
* an equatorial crossing and the next extremum of latitude for a geodesi
c is
* 90&deg;.
* *
* This class can also calculate several other quantities related to * This class can also calculate several other quantities related to
* geodesics. These are: * geodesics. These are:
* - <i>reduced length</i>. If we fix the first point and increase \e az i1 * - <i>reduced length</i>. If we fix the first point and increase \e az i1
* by \e dazi1 (radians), the second point is displaced \e m12 \e dazi1 in * by \e dazi1 (radians), the second point is displaced \e m12 \e dazi1 in
* the direction \e azi2 + 90&deg;. The quantity \e m12 is called * the direction \e azi2 + 90&deg;. The quantity \e m12 is called
* the "reduced length" and is symmetric under interchange of the two * the "reduced length" and is symmetric under interchange of the two
* points. On a curved surface the reduced length obeys a symmetry * points. On a curved surface the reduced length obeys a symmetry
* relation, \e m12 + \e m21 = 0. On a flat surface, we have \e m12 = \e * relation, \e m12 + \e m21 = 0. On a flat surface, we have \e m12 = \e
* s12. The ratio <i>s12</i>/\e m12 gives the azimuthal scale for an * s12. The ratio <i>s12</i>/\e m12 gives the azimuthal scale for an
* azimuthal equidistant projection. * azimuthal equidistant projection.
* - <i>geodesic scale</i>. Consider a reference geodesic and a second * - <i>geodesic scale</i>. Consider a reference geodesic and a second
* geodesic parallel to this one at point 1 and separated by a small * geodesic parallel to this one at point 1 and separated by a small
* distance \e dt. The separation of the two geodesics at point 2 is \ e * distance \e dt. The separation of the two geodesics at point 2 is \ e
* M12 \e dt where \e M12 is called the "geodesic scale". \e M21 is * M12 \e dt where \e M12 is called the "geodesic scale". \e M21 is
* defined similarly (with the geodesics being parallel at point 2). O n a * defined similarly (with the geodesics being parallel at point 2). O n a
* flat surface, we have \e M12 = \e M21 = 1. The quantity 1/\e M12 gi ves * flat surface, we have \e M12 = \e M21 = 1. The quantity 1/\e M12 gi ves
* the scale of the Cassini-Soldner projection. * the scale of the Cassini-Soldner projection.
* - <i>area</i>. Consider the quadrilateral bounded by the following li
nes: * - <i>area</i>. The area between the geodesic from point 1 to point 2
* the geodesic from point 1 to point 2, the meridian from point 2 to t and
he * the equation is represented by \e S12; it is the area, measured
* equator, the equator from \e lon2 to \e lon1, the meridian from the * counter-clockwise, of the geodesic quadrilateral with corners
* equator to point 1. The area of this quadrilateral is represented b * (<i>lat1</i>,<i>lon1</i>), (0,<i>lon1</i>), (0,<i>lon2</i>), and
y \e * (<i>lat2</i>,<i>lon2</i>). It can be used to compute the area of an
* S12 with a clockwise traversal of the perimeter counting as a positi y
ve * simple geodesic polygon.
* area and it can be used to compute the area of any simple geodesic
* polygon.
* *
* Overloaded versions of Geodesic::Direct, Geodesic::ArcDirect, and * Overloaded versions of Geodesic::Direct, Geodesic::ArcDirect, and
* Geodesic::Inverse allow these quantities to be returned. In addition * Geodesic::Inverse allow these quantities to be returned. In addition
* there are general functions Geodesic::GenDirect, and Geodesic::GenInve rse * there are general functions Geodesic::GenDirect, and Geodesic::GenInve rse
* which allow an arbitrary set of results to be computed. The quantitie s \e * which allow an arbitrary set of results to be computed. The quantitie s \e
* m12, \e M12, \e M21 which all specify the behavior of nearby geodesics * m12, \e M12, \e M21 which all specify the behavior of nearby geodesics
* obey addition rules. If points 1, 2, and 3 all lie on a single geodes ic, * obey addition rules. If points 1, 2, and 3 all lie on a single geodes ic,
* then the following rules hold: * then the following rules hold:
* - \e s13 = \e s12 + \e s23 * - \e s13 = \e s12 + \e s23
* - \e a13 = \e a12 + \e a23 * - \e a13 = \e a12 + \e a23
skipping to change at line 143 skipping to change at line 143
* obtained for |<i>f</i>| &lt; 0.2. Here is a table of the approximate * obtained for |<i>f</i>| &lt; 0.2. Here is a table of the approximate
* maximum error (expressed as a distance) for an ellipsoid with the same * maximum error (expressed as a distance) for an ellipsoid with the same
* major radius as the WGS84 ellipsoid and different values of the * major radius as the WGS84 ellipsoid and different values of the
* flattening.<pre> * flattening.<pre>
* |f| error * |f| error
* 0.01 25 nm * 0.01 25 nm
* 0.02 30 nm * 0.02 30 nm
* 0.05 10 um * 0.05 10 um
* 0.1 1.5 mm * 0.1 1.5 mm
* 0.2 300 mm * 0.2 300 mm
* </pre>For very eccentric ellipsoids, use GeodesicExact instead. * </pre>
* For very eccentric ellipsoids, use GeodesicExact instead.
* *
* The algorithms are described in * The algorithms are described in
* - C. F. F. Karney, * - C. F. F. Karney,
* <a href="http://dx.doi.org/10.1007/s00190-012-0578-z"> * <a href="http://dx.doi.org/10.1007/s00190-012-0578-z">
* Algorithms for geodesics</a>, * Algorithms for geodesics</a>,
* J. Geodesy <b>87</b>, 43--55 (2013); * J. Geodesy <b>87</b>, 43--55 (2013);
* DOI: <a href="http://dx.doi.org/10.1007/s00190-012-0578-z"> * DOI: <a href="http://dx.doi.org/10.1007/s00190-012-0578-z">
* 10.1007/s00190-012-0578-z</a>; * 10.1007/s00190-012-0578-z</a>;
* addenda: <a href="http://geographiclib.sf.net/geod-addenda.html"> * addenda: <a href="http://geographiclib.sf.net/geod-addenda.html">
* geod-addenda.html</a>. * geod-addenda.html</a>.
skipping to change at line 237 skipping to change at line 238
real ssig1, real csig1, real dn1, real ssig1, real csig1, real dn1,
real ssig2, real csig2, real dn2, real ssig2, real csig2, real dn2,
real cbet1, real cbet2, real cbet1, real cbet2,
real& s12s, real& m12a, real& m0, real& s12s, real& m12a, real& m0,
bool scalep, real& M12, real& M21, bool scalep, real& M12, real& M21,
real C1a[], real C2a[]) const throw(); real C1a[], real C2a[]) const throw();
real InverseStart(real sbet1, real cbet1, real dn1, real InverseStart(real sbet1, real cbet1, real dn1,
real sbet2, real cbet2, real dn2, real sbet2, real cbet2, real dn2,
real lam12, real lam12,
real& salp1, real& calp1, real& salp1, real& calp1,
real& salp2, real& calp2, real& salp2, real& calp2, real& dnm,
real C1a[], real C2a[]) const throw(); real C1a[], real C2a[]) const throw();
real Lambda12(real sbet1, real cbet1, real dn1, real Lambda12(real sbet1, real cbet1, real dn1,
real sbet2, real cbet2, real dn2, real sbet2, real cbet2, real dn2,
real salp1, real calp1, real salp1, real calp1,
real& salp2, real& calp2, real& sig12, real& salp2, real& calp2, real& sig12,
real& ssig1, real& csig1, real& ssig2, real& csig2, real& ssig1, real& csig1, real& ssig2, real& csig2,
real& eps, real& domg12, bool diffp, real& dlam12, real& eps, real& domg12, bool diffp, real& dlam12,
real C1a[], real C2a[], real C3a[]) real C1a[], real C2a[], real C3a[])
const throw(); const throw();
skipping to change at line 324 skipping to change at line 325
* Calculate geodesic scales \e M12 and \e M21. * Calculate geodesic scales \e M12 and \e M21.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
GEODESICSCALE = 1U<<13 | CAP_C1 | CAP_C2, GEODESICSCALE = 1U<<13 | CAP_C1 | CAP_C2,
/** /**
* Calculate area \e S12. * Calculate area \e S12.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
AREA = 1U<<14 | CAP_C4, AREA = 1U<<14 | CAP_C4,
/** /**
* All capabilities. Calculate everything. * All capabilities, calculate everything.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
ALL = OUT_ALL| CAP_ALL, ALL = OUT_ALL| CAP_ALL,
}; };
/** \name Constructor /** \name Constructor
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* Constructor for a ellipsoid with * Constructor for a ellipsoid with
skipping to change at line 351 skipping to change at line 352
* positive. * positive.
********************************************************************** / ********************************************************************** /
Geodesic(real a, real f); Geodesic(real a, real f);
///@} ///@}
/** \name Direct geodesic problem specified in terms of distance. /** \name Direct geodesic problem specified in terms of distance.
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* Solve the direct geodesic problem where the length of the geodesic * Solve the direct geodesic problem where the length of the geodesic
* is specify in terms of distance. * is specified in terms of distance.
* *
* @param[in] lat1 latitude of point 1 (degrees). * @param[in] lat1 latitude of point 1 (degrees).
* @param[in] lon1 longitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees).
* @param[in] azi1 azimuth at point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees).
* @param[in] s12 distance between point 1 and point 2 (meters); it can be * @param[in] s12 distance between point 1 and point 2 (meters); it can be
* negative. * negative.
* @param[out] lat2 latitude of point 2 (degrees). * @param[out] lat2 latitude of point 2 (degrees).
* @param[out] lon2 longitude of point 2 (degrees). * @param[out] lon2 longitude of point 2 (degrees).
* @param[out] azi2 (forward) azimuth at point 2 (degrees). * @param[out] azi2 (forward) azimuth at point 2 (degrees).
* @param[out] m12 reduced length of geodesic (meters). * @param[out] m12 reduced length of geodesic (meters).
skipping to change at line 375 skipping to change at line 376
* (dimensionless). * (dimensionless).
* @param[out] S12 area under the geodesic (meters<sup>2</sup>). * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
* @return \e a12 arc length of between point 1 and point 2 (degrees). * @return \e a12 arc length of between point 1 and point 2 (degrees).
* *
* \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e
* azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of * azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of
* \e lon2 and \e azi2 returned are in the range [&minus;180&deg;, * \e lon2 and \e azi2 returned are in the range [&minus;180&deg;,
* 180&deg;). * 180&deg;).
* *
* If either point is at a pole, the azimuth is defined by keeping the * If either point is at a pole, the azimuth is defined by keeping the
* longitude fixed and writing \e lat = &plusmn;(90&deg; &minus; &epsil on;) * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon; ),
* and taking the limit &epsilon; &rarr; 0+. An arc length greater tha t * and taking the limit &epsilon; &rarr; 0+. An arc length greater tha t
* 180&deg; signifies a geodesic which is not a shortest path. (For a * 180&deg; signifies a geodesic which is not a shortest path. (For a
* prolate ellipsoid, an additional condition is necessary for a shorte st * prolate ellipsoid, an additional condition is necessary for a shorte st
* path: the longitudinal extent must not exceed of 180&deg;.) * path: the longitudinal extent must not exceed of 180&deg;.)
* *
* The following functions are overloaded versions of Geodesic::Direct * The following functions are overloaded versions of Geodesic::Direct
* which omit some of the output parameters. Note, however, that the a rc * which omit some of the output parameters. Note, however, that the a rc
* length is always computed and returned as the function value. * length is always computed and returned as the function value.
********************************************************************** / ********************************************************************** /
Math::real Direct(real lat1, real lon1, real azi1, real s12, Math::real Direct(real lat1, real lon1, real azi1, real s12,
skipping to change at line 465 skipping to change at line 466
REDUCEDLENGTH | GEODESICSCALE, REDUCEDLENGTH | GEODESICSCALE,
lat2, lon2, azi2, t, m12, M12, M21, t); lat2, lon2, azi2, t, m12, M12, M21, t);
} }
///@} ///@}
/** \name Direct geodesic problem specified in terms of arc length. /** \name Direct geodesic problem specified in terms of arc length.
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* Solve the direct geodesic problem where the length of the geodesic * Solve the direct geodesic problem where the length of the geodesic
* is specify in terms of arc length. * is specified in terms of arc length.
* *
* @param[in] lat1 latitude of point 1 (degrees). * @param[in] lat1 latitude of point 1 (degrees).
* @param[in] lon1 longitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees).
* @param[in] azi1 azimuth at point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees).
* @param[in] a12 arc length between point 1 and point 2 (degrees); it can * @param[in] a12 arc length between point 1 and point 2 (degrees); it can
* be negative. * be negative.
* @param[out] lat2 latitude of point 2 (degrees). * @param[out] lat2 latitude of point 2 (degrees).
* @param[out] lon2 longitude of point 2 (degrees). * @param[out] lon2 longitude of point 2 (degrees).
* @param[out] azi2 (forward) azimuth at point 2 (degrees). * @param[out] azi2 (forward) azimuth at point 2 (degrees).
* @param[out] s12 distance between point 1 and point 2 (meters). * @param[out] s12 distance between point 1 and point 2 (meters).
skipping to change at line 489 skipping to change at line 490
* @param[out] M21 geodesic scale of point 1 relative to point 2 * @param[out] M21 geodesic scale of point 1 relative to point 2
* (dimensionless). * (dimensionless).
* @param[out] S12 area under the geodesic (meters<sup>2</sup>). * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
* *
* \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e
* azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of * azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of
* \e lon2 and \e azi2 returned are in the range [&minus;180&deg;, * \e lon2 and \e azi2 returned are in the range [&minus;180&deg;,
* 180&deg;). * 180&deg;).
* *
* If either point is at a pole, the azimuth is defined by keeping the * If either point is at a pole, the azimuth is defined by keeping the
* longitude fixed and writing \e lat = &plusmn;(90&deg; &minus; &epsil on;) * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon; ),
* and taking the limit &epsilon; &rarr; 0+. An arc length greater tha t * and taking the limit &epsilon; &rarr; 0+. An arc length greater tha t
* 180&deg; signifies a geodesic which is not a shortest path. (For a * 180&deg; signifies a geodesic which is not a shortest path. (For a
* prolate ellipsoid, an additional condition is necessary for a shorte st * prolate ellipsoid, an additional condition is necessary for a shorte st
* path: the longitudinal extent must not exceed of 180&deg;.) * path: the longitudinal extent must not exceed of 180&deg;.)
* *
* The following functions are overloaded versions of Geodesic::Direct * The following functions are overloaded versions of Geodesic::Direct
* which omit some of the output parameters. * which omit some of the output parameters.
********************************************************************** / ********************************************************************** /
void ArcDirect(real lat1, real lon1, real azi1, real a12, void ArcDirect(real lat1, real lon1, real azi1, real a12,
real& lat2, real& lon2, real& azi2, real& s12, real& lat2, real& lon2, real& azi2, real& s12,
skipping to change at line 613 skipping to change at line 614
* @param[out] s12 distance between point 1 and point 2 (meters). * @param[out] s12 distance between point 1 and point 2 (meters).
* @param[out] m12 reduced length of geodesic (meters). * @param[out] m12 reduced length of geodesic (meters).
* @param[out] M12 geodesic scale of point 2 relative to point 1 * @param[out] M12 geodesic scale of point 2 relative to point 1
* (dimensionless). * (dimensionless).
* @param[out] M21 geodesic scale of point 1 relative to point 2 * @param[out] M21 geodesic scale of point 1 relative to point 2
* (dimensionless). * (dimensionless).
* @param[out] S12 area under the geodesic (meters<sup>2</sup>). * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
* @return \e a12 arc length of between point 1 and point 2 (degrees). * @return \e a12 arc length of between point 1 and point 2 (degrees).
* *
* The Geodesic::mask values possible for \e outmask are * The Geodesic::mask values possible for \e outmask are
* - \e outmask |= Geodesic::LATITUDE for the latitude \e lat2. * - \e outmask |= Geodesic::LATITUDE for the latitude \e lat2;
* - \e outmask |= Geodesic::LONGITUDE for the latitude \e lon2. * - \e outmask |= Geodesic::LONGITUDE for the latitude \e lon2;
* - \e outmask |= Geodesic::AZIMUTH for the latitude \e azi2. * - \e outmask |= Geodesic::AZIMUTH for the latitude \e azi2;
* - \e outmask |= Geodesic::DISTANCE for the distance \e s12. * - \e outmask |= Geodesic::DISTANCE for the distance \e s12;
* - \e outmask |= Geodesic::REDUCEDLENGTH for the reduced length \e * - \e outmask |= Geodesic::REDUCEDLENGTH for the reduced length \e
* m12. * m12;
* - \e outmask |= Geodesic::GEODESICSCALE for the geodesic scales \e * - \e outmask |= Geodesic::GEODESICSCALE for the geodesic scales \e
* M12 and \e M21. * M12 and \e M21;
* - \e outmask |= Geodesic::AREA for the area \e S12. * - \e outmask |= Geodesic::AREA for the area \e S12;
* - \e outmask |= Geodesic::ALL for all of the above.
* . * .
* The function value \e a12 is always computed and returned and this * The function value \e a12 is always computed and returned and this
* equals \e s12_a12 is \e arcmode is true. If \e outmask includes * equals \e s12_a12 is \e arcmode is true. If \e outmask includes
* Geodesic::DISTANCE and \e arcmode is false, then \e s12 = \e s12_a12 . * Geodesic::DISTANCE and \e arcmode is false, then \e s12 = \e s12_a12 .
* It is not necessary to include Geodesic::DISTANCE_IN in \e outmask; this * It is not necessary to include Geodesic::DISTANCE_IN in \e outmask; this
* is automatically included is \e arcmode is false. * is automatically included is \e arcmode is false.
********************************************************************** / ********************************************************************** /
Math::real GenDirect(real lat1, real lon1, real azi1, Math::real GenDirect(real lat1, real lon1, real azi1,
bool arcmode, real s12_a12, unsigned outmask, bool arcmode, real s12_a12, unsigned outmask,
real& lat2, real& lon2, real& azi2, real& lat2, real& lon2, real& azi2,
skipping to change at line 663 skipping to change at line 665
* (dimensionless). * (dimensionless).
* @param[out] S12 area under the geodesic (meters<sup>2</sup>). * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
* @return \e a12 arc length of between point 1 and point 2 (degrees). * @return \e a12 arc length of between point 1 and point 2 (degrees).
* *
* \e lat1 and \e lat2 should be in the range [&minus;90&deg;, 90&deg;] ; \e * \e lat1 and \e lat2 should be in the range [&minus;90&deg;, 90&deg;] ; \e
* lon1 and \e lon2 should be in the range [&minus;540&deg;, 540&deg;). * lon1 and \e lon2 should be in the range [&minus;540&deg;, 540&deg;).
* The values of \e azi1 and \e azi2 returned are in the range * The values of \e azi1 and \e azi2 returned are in the range
* [&minus;180&deg;, 180&deg;). * [&minus;180&deg;, 180&deg;).
* *
* If either point is at a pole, the azimuth is defined by keeping the * If either point is at a pole, the azimuth is defined by keeping the
* longitude fixed and writing \e lat = &plusmn;(90&deg; &minus; &epsil on;) * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon; ),
* and taking the limit &epsilon; &rarr; 0+. * and taking the limit &epsilon; &rarr; 0+.
* *
* The solution to the inverse problem is found using Newton's method. If * The solution to the inverse problem is found using Newton's method. If
* this fails to converge (this is very unlikely in geodetic applicatio ns * this fails to converge (this is very unlikely in geodetic applicatio ns
* but does occur for very eccentric ellipsoids), then the bisection me thod * but does occur for very eccentric ellipsoids), then the bisection me thod
* is used to refine the solution. * is used to refine the solution.
* *
* The following functions are overloaded versions of Geodesic::Inverse * The following functions are overloaded versions of Geodesic::Inverse
* which omit some of the output parameters. Note, however, that the a rc * which omit some of the output parameters. Note, however, that the a rc
* length is always computed and returned as the function value. * length is always computed and returned as the function value.
skipping to change at line 781 skipping to change at line 783
* @param[out] azi2 (forward) azimuth at point 2 (degrees). * @param[out] azi2 (forward) azimuth at point 2 (degrees).
* @param[out] m12 reduced length of geodesic (meters). * @param[out] m12 reduced length of geodesic (meters).
* @param[out] M12 geodesic scale of point 2 relative to point 1 * @param[out] M12 geodesic scale of point 2 relative to point 1
* (dimensionless). * (dimensionless).
* @param[out] M21 geodesic scale of point 1 relative to point 2 * @param[out] M21 geodesic scale of point 1 relative to point 2
* (dimensionless). * (dimensionless).
* @param[out] S12 area under the geodesic (meters<sup>2</sup>). * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
* @return \e a12 arc length of between point 1 and point 2 (degrees). * @return \e a12 arc length of between point 1 and point 2 (degrees).
* *
* The Geodesic::mask values possible for \e outmask are * The Geodesic::mask values possible for \e outmask are
* - \e outmask |= Geodesic::DISTANCE for the distance \e s12. * - \e outmask |= Geodesic::DISTANCE for the distance \e s12;
* - \e outmask |= Geodesic::AZIMUTH for the latitude \e azi2. * - \e outmask |= Geodesic::AZIMUTH for the latitude \e azi2;
* - \e outmask |= Geodesic::REDUCEDLENGTH for the reduced length \e * - \e outmask |= Geodesic::REDUCEDLENGTH for the reduced length \e
* m12. * m12;
* - \e outmask |= Geodesic::GEODESICSCALE for the geodesic scales \e * - \e outmask |= Geodesic::GEODESICSCALE for the geodesic scales \e
* M12 and \e M21. * M12 and \e M21;
* - \e outmask |= Geodesic::AREA for the area \e S12. * - \e outmask |= Geodesic::AREA for the area \e S12;
* - \e outmask |= Geodesic::ALL for all of the above.
* . * .
* The arc length is always computed and returned as the function value . * The arc length is always computed and returned as the function value .
********************************************************************** / ********************************************************************** /
Math::real GenInverse(real lat1, real lon1, real lat2, real lon2, Math::real GenInverse(real lat1, real lon1, real lat2, real lon2,
unsigned outmask, unsigned outmask,
real& s12, real& azi1, real& azi2, real& s12, real& azi1, real& azi2,
real& m12, real& M12, real& M21, real& S12) real& m12, real& M12, real& M21, real& S12)
const throw(); const throw();
///@} ///@}
/** \name Interface to GeodesicLine. /** \name Interface to GeodesicLine.
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* Set up to compute several points on a singe geodesic. * Set up to compute several points on a single geodesic.
* *
* @param[in] lat1 latitude of point 1 (degrees). * @param[in] lat1 latitude of point 1 (degrees).
* @param[in] lon1 longitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees).
* @param[in] azi1 azimuth at point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees).
* @param[in] caps bitor'ed combination of Geodesic::mask values * @param[in] caps bitor'ed combination of Geodesic::mask values
* specifying the capabilities the GeodesicLine object should possess , * specifying the capabilities the GeodesicLine object should possess ,
* i.e., which quantities can be returned in calls to * i.e., which quantities can be returned in calls to
* GeodesicLib::Position. * GeodesicLine::Position.
* @return a GeodesicLine object.
* *
* \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e
* azi1 should be in the range [&minus;540&deg;, 540&deg;). * azi1 should be in the range [&minus;540&deg;, 540&deg;).
* *
* The Geodesic::mask values are * The Geodesic::mask values are
* - \e caps |= Geodesic::LATITUDE for the latitude \e lat2; this is * - \e caps |= Geodesic::LATITUDE for the latitude \e lat2; this is
* added automatically * added automatically;
* - \e caps |= Geodesic::LONGITUDE for the latitude \e lon2 * - \e caps |= Geodesic::LONGITUDE for the latitude \e lon2;
* - \e caps |= Geodesic::AZIMUTH for the azimuth \e azi2; this is * - \e caps |= Geodesic::AZIMUTH for the azimuth \e azi2; this is
* added automatically * added automatically;
* - \e caps |= Geodesic::DISTANCE for the distance \e s12 * - \e caps |= Geodesic::DISTANCE for the distance \e s12;
* - \e caps |= Geodesic::REDUCEDLENGTH for the reduced length \e m12 * - \e caps |= Geodesic::REDUCEDLENGTH for the reduced length \e m12;
* - \e caps |= Geodesic::GEODESICSCALE for the geodesic scales \e M12 * - \e caps |= Geodesic::GEODESICSCALE for the geodesic scales \e M12
* and \e M21 * and \e M21;
* - \e caps |= Geodesic::AREA for the area \e S12 * - \e caps |= Geodesic::AREA for the area \e S12;
* - \e caps |= Geodesic::DISTANCE_IN permits the length of the * - \e caps |= Geodesic::DISTANCE_IN permits the length of the
* geodesic to be given in terms of \e s12; without this capability t he * geodesic to be given in terms of \e s12; without this capability t he
* length can only be specified in terms of arc length. * length can only be specified in terms of arc length;
* - \e caps |= Geodesic::ALL for all of the above.
* . * .
* The default value of \e caps is Geodesic::ALL which turns on all the * The default value of \e caps is Geodesic::ALL.
* capabilities.
* *
* If the point is at a pole, the azimuth is defined by keeping the \e * If the point is at a pole, the azimuth is defined by keeping \e lon1
lon1 * fixed, writing \e lat1 = &plusmn;(90 &minus; &epsilon;), and taking
* fixed and writing \e lat1 = &plusmn;&(90 &minus; &epsilon;) and taki the
ng * limit &epsilon; &rarr; 0+.
* the limit &epsilon; &rarr; 0+.
********************************************************************** / ********************************************************************** /
GeodesicLine Line(real lat1, real lon1, real azi1, unsigned caps = ALL) GeodesicLine Line(real lat1, real lon1, real azi1, unsigned caps = ALL)
const throw(); const throw();
///@} ///@}
/** \name Inspector functions. /** \name Inspector functions.
********************************************************************** / ********************************************************************** /
///@{ ///@{
 End of changes. 25 change blocks. 
55 lines changed or deleted 59 lines changed or added


 GeodesicExact.hpp   GeodesicExact.hpp 
/** /**
* \file GeodesicExact.hpp * \file GeodesicExact.hpp
* \brief Header for GeographicLib::GeodesicExact class * \brief Header for GeographicLib::GeodesicExact class
* *
* Copyright (c) Charles Karney (2012) <charles@karney.com> and licensed un * Copyright (c) Charles Karney (2012-2013) <charles@karney.com> and licens
der ed
* the MIT/X11 License. For more information, see * under the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_GEODESICEXACT_HPP) #if !defined(GEOGRAPHICLIB_GEODESICEXACT_HPP)
#define GEOGRAPHICLIB_GEODESICEXACT_HPP 1 #define GEOGRAPHICLIB_GEODESICEXACT_HPP 1
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/EllipticFunction.hpp> #include <GeographicLib/EllipticFunction.hpp>
#if !defined(GEOGRAPHICLIB_GEODESICEXACT_ORDER) #if !defined(GEOGRAPHICLIB_GEODESICEXACT_ORDER)
skipping to change at line 144 skipping to change at line 144
real ssig1, real csig1, real dn1, real ssig1, real csig1, real dn1,
real ssig2, real csig2, real dn2, real ssig2, real csig2, real dn2,
real cbet1, real cbet2, real cbet1, real cbet2,
real& s12s, real& m12a, real& m0, real& s12s, real& m12a, real& m0,
bool scalep, real& M12, real& M21) const throw(); bool scalep, real& M12, real& M21) const throw();
real InverseStart(EllipticFunction& E, real InverseStart(EllipticFunction& E,
real sbet1, real cbet1, real dn1, real sbet1, real cbet1, real dn1,
real sbet2, real cbet2, real dn2, real sbet2, real cbet2, real dn2,
real lam12, real lam12,
real& salp1, real& calp1, real& salp1, real& calp1,
real& salp2, real& calp2) const throw(); real& salp2, real& calp2, real& dnm) const throw();
real Lambda12(real sbet1, real cbet1, real dn1, real Lambda12(real sbet1, real cbet1, real dn1,
real sbet2, real cbet2, real dn2, real sbet2, real cbet2, real dn2,
real salp1, real calp1, real salp1, real calp1,
real& salp2, real& calp2, real& sig12, real& salp2, real& calp2, real& sig12,
real& ssig1, real& csig1, real& ssig2, real& csig2, real& ssig1, real& csig1, real& ssig2, real& csig2,
EllipticFunction& E, EllipticFunction& E,
real& omg12, bool diffp, real& dlam12) real& omg12, bool diffp, real& dlam12)
const throw(); const throw();
// These are Maxima generated functions to provide series approximation s to // These are Maxima generated functions to provide series approximation s to
skipping to change at line 221 skipping to change at line 221
* Calculate geodesic scales \e M12 and \e M21. * Calculate geodesic scales \e M12 and \e M21.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
GEODESICSCALE = 1U<<13 | CAP_D, GEODESICSCALE = 1U<<13 | CAP_D,
/** /**
* Calculate area \e S12. * Calculate area \e S12.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
AREA = 1U<<14 | CAP_C4, AREA = 1U<<14 | CAP_C4,
/** /**
* All capabilities. Calculate everything. * All capabilities, calculate everything.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
ALL = OUT_ALL| CAP_ALL, ALL = OUT_ALL| CAP_ALL,
}; };
/** \name Constructor /** \name Constructor
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* Constructor for a ellipsoid with * Constructor for a ellipsoid with
skipping to change at line 248 skipping to change at line 248
* positive. * positive.
********************************************************************** / ********************************************************************** /
GeodesicExact(real a, real f); GeodesicExact(real a, real f);
///@} ///@}
/** \name Direct geodesic problem specified in terms of distance. /** \name Direct geodesic problem specified in terms of distance.
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* Perform the direct geodesic calculation where the length of the geod esic * Perform the direct geodesic calculation where the length of the geod esic
* is specify in terms of distance. * is specified in terms of distance.
* *
* @param[in] lat1 latitude of point 1 (degrees). * @param[in] lat1 latitude of point 1 (degrees).
* @param[in] lon1 longitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees).
* @param[in] azi1 azimuth at point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees).
* @param[in] s12 distance between point 1 and point 2 (meters); it can be * @param[in] s12 distance between point 1 and point 2 (meters); it can be
* signed. * signed.
* @param[out] lat2 latitude of point 2 (degrees). * @param[out] lat2 latitude of point 2 (degrees).
* @param[out] lon2 longitude of point 2 (degrees). * @param[out] lon2 longitude of point 2 (degrees).
* @param[out] azi2 (forward) azimuth at point 2 (degrees). * @param[out] azi2 (forward) azimuth at point 2 (degrees).
* @param[out] m12 reduced length of geodesic (meters). * @param[out] m12 reduced length of geodesic (meters).
skipping to change at line 272 skipping to change at line 272
* (dimensionless). * (dimensionless).
* @param[out] S12 area under the geodesic (meters<sup>2</sup>). * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
* @return \e a12 arc length of between point 1 and point 2 (degrees). * @return \e a12 arc length of between point 1 and point 2 (degrees).
* *
* \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e
* azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of * azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of
* \e lon2 and \e azi2 returned are in the range [&minus;180&deg;, * \e lon2 and \e azi2 returned are in the range [&minus;180&deg;,
* 180&deg;). * 180&deg;).
* *
* If either point is at a pole, the azimuth is defined by keeping the * If either point is at a pole, the azimuth is defined by keeping the
* longitude fixed and writing \e lat = &plusmn;(90&deg; &minus; &epsil * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;
on;) ),
* and taking the limit &epsilon; &rarr; 0+.. An arc length greater th * and taking the limit &epsilon; &rarr; 0+. An arc length greater tha
at t
* 180&deg; signifies a geodesic which is not a shortest path. (For a * 180&deg; signifies a geodesic which is not a shortest path. (For a
* prolate ellipsoid, an additional condition is necessary for a shorte st * prolate ellipsoid, an additional condition is necessary for a shorte st
* path: the longitudinal extent must not exceed of 180&deg;.) * path: the longitudinal extent must not exceed of 180&deg;.)
* *
* The following functions are overloaded versions of GeodesicExact::Di rect * The following functions are overloaded versions of GeodesicExact::Di rect
* which omit some of the output parameters. Note, however, that the a rc * which omit some of the output parameters. Note, however, that the a rc
* length is always computed and returned as the function value. * length is always computed and returned as the function value.
********************************************************************** / ********************************************************************** /
Math::real Direct(real lat1, real lon1, real azi1, real s12, Math::real Direct(real lat1, real lon1, real azi1, real s12,
real& lat2, real& lon2, real& azi2, real& lat2, real& lon2, real& azi2,
skipping to change at line 362 skipping to change at line 362
REDUCEDLENGTH | GEODESICSCALE, REDUCEDLENGTH | GEODESICSCALE,
lat2, lon2, azi2, t, m12, M12, M21, t); lat2, lon2, azi2, t, m12, M12, M21, t);
} }
///@} ///@}
/** \name Direct geodesic problem specified in terms of arc length. /** \name Direct geodesic problem specified in terms of arc length.
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* Perform the direct geodesic calculation where the length of the geod esic * Perform the direct geodesic calculation where the length of the geod esic
* is specify in terms of arc length. * is specified in terms of arc length.
* *
* @param[in] lat1 latitude of point 1 (degrees). * @param[in] lat1 latitude of point 1 (degrees).
* @param[in] lon1 longitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees).
* @param[in] azi1 azimuth at point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees).
* @param[in] a12 arc length between point 1 and point 2 (degrees); it can * @param[in] a12 arc length between point 1 and point 2 (degrees); it can
* be signed. * be signed.
* @param[out] lat2 latitude of point 2 (degrees). * @param[out] lat2 latitude of point 2 (degrees).
* @param[out] lon2 longitude of point 2 (degrees). * @param[out] lon2 longitude of point 2 (degrees).
* @param[out] azi2 (forward) azimuth at point 2 (degrees). * @param[out] azi2 (forward) azimuth at point 2 (degrees).
* @param[out] s12 distance between point 1 and point 2 (meters). * @param[out] s12 distance between point 1 and point 2 (meters).
skipping to change at line 386 skipping to change at line 386
* @param[out] M21 geodesic scale of point 1 relative to point 2 * @param[out] M21 geodesic scale of point 1 relative to point 2
* (dimensionless). * (dimensionless).
* @param[out] S12 area under the geodesic (meters<sup>2</sup>). * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
* *
* \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e
* azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of * azi1 should be in the range [&minus;540&deg;, 540&deg;). The values of
* \e lon2 and \e azi2 returned are in the range [&minus;180&deg;, * \e lon2 and \e azi2 returned are in the range [&minus;180&deg;,
* 180&deg;). * 180&deg;).
* *
* If either point is at a pole, the azimuth is defined by keeping the * If either point is at a pole, the azimuth is defined by keeping the
* longitude fixed and writing \e lat = &plusmn;(90&deg; &minus; &epsil on;) * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon; ),
* and taking the limit &epsilon; &rarr; 0+. An arc length greater tha t * and taking the limit &epsilon; &rarr; 0+. An arc length greater tha t
* 180&deg; signifies a geodesic which is not a shortest path. (For a * 180&deg; signifies a geodesic which is not a shortest path. (For a
* prolate ellipsoid, an additional condition is necessary for a shorte st * prolate ellipsoid, an additional condition is necessary for a shorte st
* path: the longitudinal extent must not exceed of 180&deg;.) * path: the longitudinal extent must not exceed of 180&deg;.)
* *
* The following functions are overloaded versions of GeodesicExact::Di rect * The following functions are overloaded versions of GeodesicExact::Di rect
* which omit some of the output parameters. * which omit some of the output parameters.
********************************************************************** / ********************************************************************** /
void ArcDirect(real lat1, real lon1, real azi1, real a12, void ArcDirect(real lat1, real lon1, real azi1, real a12,
real& lat2, real& lon2, real& azi2, real& s12, real& lat2, real& lon2, real& azi2, real& s12,
skipping to change at line 510 skipping to change at line 510
* @param[out] s12 distance between point 1 and point 2 (meters). * @param[out] s12 distance between point 1 and point 2 (meters).
* @param[out] m12 reduced length of geodesic (meters). * @param[out] m12 reduced length of geodesic (meters).
* @param[out] M12 geodesic scale of point 2 relative to point 1 * @param[out] M12 geodesic scale of point 2 relative to point 1
* (dimensionless). * (dimensionless).
* @param[out] M21 geodesic scale of point 1 relative to point 2 * @param[out] M21 geodesic scale of point 1 relative to point 2
* (dimensionless). * (dimensionless).
* @param[out] S12 area under the geodesic (meters<sup>2</sup>). * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
* @return \e a12 arc length of between point 1 and point 2 (degrees). * @return \e a12 arc length of between point 1 and point 2 (degrees).
* *
* The GeodesicExact::mask values possible for \e outmask are * The GeodesicExact::mask values possible for \e outmask are
* - \e outmask |= GeodesicExact::LATITUDE for the latitude \e lat2. * - \e outmask |= GeodesicExact::LATITUDE for the latitude \e lat2;
* - \e outmask |= GeodesicExact::LONGITUDE for the latitude \e lon2. * - \e outmask |= GeodesicExact::LONGITUDE for the latitude \e lon2;
* - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2. * - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2;
* - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12. * - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12;
* - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length \e * - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length \e
* m12. * m12;
* - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales \e * - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales \e
* M12 and \e M21. * M12 and \e M21;
* - \e outmask |= GeodesicExact::AREA for the area \e S12. * - \e outmask |= GeodesicExact::AREA for the area \e S12;
* - \e outmask |= GeodesicExact::ALL for all of the above.
* . * .
* The function value \e a12 is always computed and returned and this * The function value \e a12 is always computed and returned and this
* equals \e s12_a12 is \e arcmode is true. If \e outmask includes * equals \e s12_a12 is \e arcmode is true. If \e outmask includes
* GeodesicExact::DISTANCE and \e arcmode is false, then \e s12 = \e * GeodesicExact::DISTANCE and \e arcmode is false, then \e s12 = \e
* s12_a12. It is not necessary to include GeodesicExact::DISTANCE_IN in * s12_a12. It is not necessary to include GeodesicExact::DISTANCE_IN in
* \e outmask; this is automatically included is \e arcmode is false. * \e outmask; this is automatically included is \e arcmode is false.
********************************************************************** / ********************************************************************** /
Math::real GenDirect(real lat1, real lon1, real azi1, Math::real GenDirect(real lat1, real lon1, real azi1,
bool arcmode, real s12_a12, unsigned outmask, bool arcmode, real s12_a12, unsigned outmask,
real& lat2, real& lon2, real& azi2, real& lat2, real& lon2, real& azi2,
skipping to change at line 560 skipping to change at line 561
* (dimensionless). * (dimensionless).
* @param[out] S12 area under the geodesic (meters<sup>2</sup>). * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
* @return \e a12 arc length of between point 1 and point 2 (degrees). * @return \e a12 arc length of between point 1 and point 2 (degrees).
* *
* \e lat1 and \e lat2 should be in the range [&minus;90&deg;, 90&deg;] ; \e * \e lat1 and \e lat2 should be in the range [&minus;90&deg;, 90&deg;] ; \e
* lon1 and \e lon2 should be in the range [&minus;540&deg;, 540&deg;). * lon1 and \e lon2 should be in the range [&minus;540&deg;, 540&deg;).
* The values of \e azi1 and \e azi2 returned are in the range * The values of \e azi1 and \e azi2 returned are in the range
* [&minus;180&deg;, 180&deg;). * [&minus;180&deg;, 180&deg;).
* *
* If either point is at a pole, the azimuth is defined by keeping the * If either point is at a pole, the azimuth is defined by keeping the
* longitude fixed and writing \e lat = &plusmn;(90&deg; &minus; &epsil on;) * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon; ),
* and taking the limit &epsilon; &rarr; 0+. * and taking the limit &epsilon; &rarr; 0+.
* *
* The following functions are overloaded versions of GeodesicExact::In verse * The following functions are overloaded versions of GeodesicExact::In verse
* which omit some of the output parameters. Note, however, that the a rc * which omit some of the output parameters. Note, however, that the a rc
* length is always computed and returned as the function value. * length is always computed and returned as the function value.
********************************************************************** / ********************************************************************** /
Math::real Inverse(real lat1, real lon1, real lat2, real lon2, Math::real Inverse(real lat1, real lon1, real lat2, real lon2,
real& s12, real& azi1, real& azi2, real& m12, real& s12, real& azi1, real& azi2, real& m12,
real& M12, real& M21, real& S12) const throw() { real& M12, real& M21, real& S12) const throw() {
return GenInverse(lat1, lon1, lat2, lon2, return GenInverse(lat1, lon1, lat2, lon2,
skipping to change at line 673 skipping to change at line 674
* @param[out] azi2 (forward) azimuth at point 2 (degrees). * @param[out] azi2 (forward) azimuth at point 2 (degrees).
* @param[out] m12 reduced length of geodesic (meters). * @param[out] m12 reduced length of geodesic (meters).
* @param[out] M12 geodesic scale of point 2 relative to point 1 * @param[out] M12 geodesic scale of point 2 relative to point 1
* (dimensionless). * (dimensionless).
* @param[out] M21 geodesic scale of point 1 relative to point 2 * @param[out] M21 geodesic scale of point 1 relative to point 2
* (dimensionless). * (dimensionless).
* @param[out] S12 area under the geodesic (meters<sup>2</sup>). * @param[out] S12 area under the geodesic (meters<sup>2</sup>).
* @return \e a12 arc length of between point 1 and point 2 (degrees). * @return \e a12 arc length of between point 1 and point 2 (degrees).
* *
* The GeodesicExact::mask values possible for \e outmask are * The GeodesicExact::mask values possible for \e outmask are
* - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12. * - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12;
* - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2. * - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2;
* - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length \e * - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length \e
* m12. * m12;
* - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales \e * - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales \e
* M12 and \e M21. * M12 and \e M21;
* - \e outmask |= GeodesicExact::AREA for the area \e S12. * - \e outmask |= GeodesicExact::AREA for the area \e S12;
* - \e outmask |= GeodesicExact::ALL for all of the above.
* . * .
* The arc length is always computed and returned as the function value . * The arc length is always computed and returned as the function value .
********************************************************************** / ********************************************************************** /
Math::real GenInverse(real lat1, real lon1, real lat2, real lon2, Math::real GenInverse(real lat1, real lon1, real lat2, real lon2,
unsigned outmask, unsigned outmask,
real& s12, real& azi1, real& azi2, real& s12, real& azi1, real& azi2,
real& m12, real& M12, real& M21, real& S12) real& m12, real& M12, real& M21, real& S12)
const throw(); const throw();
///@} ///@}
/** \name Interface to GeodesicLineExact. /** \name Interface to GeodesicLineExact.
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* Set up to compute several points on a singe geodesic. * Set up to compute several points on a single geodesic.
* *
* @param[in] lat1 latitude of point 1 (degrees). * @param[in] lat1 latitude of point 1 (degrees).
* @param[in] lon1 longitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees).
* @param[in] azi1 azimuth at point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees).
* @param[in] caps bitor'ed combination of GeodesicExact::mask values * @param[in] caps bitor'ed combination of GeodesicExact::mask values
* specifying the capabilities the GeodesicLineExact object should * specifying the capabilities the GeodesicLineExact object should
* possess, i.e., which quantities can be returned in calls to * possess, i.e., which quantities can be returned in calls to
* GeodesicLib::Position. * GeodesicLineExact::Position.
* @return a GeodesicLineExact object.
* *
* \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e
* azi1 should be in the range [&minus;540&deg;, 540&deg;). * azi1 should be in the range [&minus;540&deg;, 540&deg;).
* *
* The GeodesicExact::mask values are * The GeodesicExact::mask values are
* - \e caps |= GeodesicExact::LATITUDE for the latitude \e lat2; this is * - \e caps |= GeodesicExact::LATITUDE for the latitude \e lat2; this is
* added automatically * added automatically;
* - \e caps |= GeodesicExact::LONGITUDE for the latitude \e lon2 * - \e caps |= GeodesicExact::LONGITUDE for the latitude \e lon2;
* - \e caps |= GeodesicExact::AZIMUTH for the azimuth \e azi2; this is * - \e caps |= GeodesicExact::AZIMUTH for the azimuth \e azi2; this is
* added automatically * added automatically;
* - \e caps |= GeodesicExact::DISTANCE for the distance \e s12 * - \e caps |= GeodesicExact::DISTANCE for the distance \e s12;
* - \e caps |= GeodesicExact::REDUCEDLENGTH for the reduced length \e * - \e caps |= GeodesicExact::REDUCEDLENGTH for the reduced length \e
m12 m12;
* - \e caps |= GeodesicExact::GEODESICSCALE for the geodesic scales \e M12 * - \e caps |= GeodesicExact::GEODESICSCALE for the geodesic scales \e M12
* and \e M21 * and \e M21;
* - \e caps |= GeodesicExact::AREA for the area \e S12 * - \e caps |= GeodesicExact::AREA for the area \e S12;
* - \e caps |= GeodesicExact::DISTANCE_IN permits the length of the * - \e caps |= GeodesicExact::DISTANCE_IN permits the length of the
* geodesic to be given in terms of \e s12; without this capability t he * geodesic to be given in terms of \e s12; without this capability t he
* length can only be specified in terms of arc length. * length can only be specified in terms of arc length;
* - \e caps |= GeodesicExact::ALL for all of the above.
* . * .
* The default value of \e caps is GeodesicExact::ALL which turns on al l * The default value of \e caps is GeodesicExact::ALL which turns on al l
* the capabilities. * the capabilities.
* *
* If the point is at a pole, the azimuth is defined by keeping the \e * If the point is at a pole, the azimuth is defined by keeping \e lon1
lon1 * fixed, writing \e lat1 = &plusmn;(90 &minus; &epsilon;), and taking
* fixed and writing \e lat1 = 90 &minus; &epsilon; or &minus;90 + the
* &epsilon; and taking the limit &epsilon; &rarr; 0 from above. * limit &epsilon; &rarr; 0+.
********************************************************************** / ********************************************************************** /
GeodesicLineExact Line(real lat1, real lon1, real azi1, unsigned caps = ALL) GeodesicLineExact Line(real lat1, real lon1, real azi1, unsigned caps = ALL)
const throw(); const throw();
///@} ///@}
/** \name Inspector functions. /** \name Inspector functions.
********************************************************************** / ********************************************************************** /
///@{ ///@{
 End of changes. 21 change blocks. 
40 lines changed or deleted 44 lines changed or added


 GeodesicLine.hpp   GeodesicLine.hpp 
skipping to change at line 147 skipping to change at line 147
* Calculate geodesic scales \e M12 and \e M21. * Calculate geodesic scales \e M12 and \e M21.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
GEODESICSCALE = Geodesic::GEODESICSCALE, GEODESICSCALE = Geodesic::GEODESICSCALE,
/** /**
* Calculate area \e S12. * Calculate area \e S12.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
AREA = Geodesic::AREA, AREA = Geodesic::AREA,
/** /**
* All capabilities. Calculate everything. * All capabilities, calculate everything.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
ALL = Geodesic::ALL, ALL = Geodesic::ALL,
}; };
/** \name Constructors /** \name Constructors
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
skipping to change at line 169 skipping to change at line 169
* \e lon1, and azimuth \e azi1 (all in degrees). * \e lon1, and azimuth \e azi1 (all in degrees).
* *
* @param[in] g A Geodesic object used to compute the necessary informa tion * @param[in] g A Geodesic object used to compute the necessary informa tion
* about the GeodesicLine. * about the GeodesicLine.
* @param[in] lat1 latitude of point 1 (degrees). * @param[in] lat1 latitude of point 1 (degrees).
* @param[in] lon1 longitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees).
* @param[in] azi1 azimuth at point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees).
* @param[in] caps bitor'ed combination of GeodesicLine::mask values * @param[in] caps bitor'ed combination of GeodesicLine::mask values
* specifying the capabilities the GeodesicLine object should possess , * specifying the capabilities the GeodesicLine object should possess ,
* i.e., which quantities can be returned in calls to * i.e., which quantities can be returned in calls to
* GeodesicLib::Position. * GeodesicLine::Position.
* *
* \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e
* azi1 should be in the range [&minus;540&deg;, 540&deg;). * azi1 should be in the range [&minus;540&deg;, 540&deg;).
* *
* The GeodesicLine::mask values are * The GeodesicLine::mask values are
* - \e caps |= GeodesicLine::LATITUDE for the latitude \e lat2; this i s * - \e caps |= GeodesicLine::LATITUDE for the latitude \e lat2; this i s
* added automatically * added automatically;
* - \e caps |= GeodesicLine::LONGITUDE for the latitude \e lon2 * - \e caps |= GeodesicLine::LONGITUDE for the latitude \e lon2;
* - \e caps |= GeodesicLine::AZIMUTH for the latitude \e azi2; this is * - \e caps |= GeodesicLine::AZIMUTH for the latitude \e azi2; this is
* added automatically * added automatically;
* - \e caps |= GeodesicLine::DISTANCE for the distance \e s12 * - \e caps |= GeodesicLine::DISTANCE for the distance \e s12;
* - \e caps |= GeodesicLine::REDUCEDLENGTH for the reduced length \e m * - \e caps |= GeodesicLine::REDUCEDLENGTH for the reduced length \e m
12 12;
* - \e caps |= GeodesicLine::GEODESICSCALE for the geodesic scales \e M12 * - \e caps |= GeodesicLine::GEODESICSCALE for the geodesic scales \e M12
* and \e M21 * and \e M21;
* - \e caps |= GeodesicLine::AREA for the area \e S12 * - \e caps |= GeodesicLine::AREA for the area \e S12;
* - \e caps |= GeodesicLine::DISTANCE_IN permits the length of the * - \e caps |= GeodesicLine::DISTANCE_IN permits the length of the
* geodesic to be given in terms of \e s12; without this capability t he * geodesic to be given in terms of \e s12; without this capability t he
* length can only be specified in terms of arc length. * length can only be specified in terms of arc length;
* - \e caps |= GeodesicLine::ALL for all of the above.
* . * .
* The default value of \e caps is GeodesicLine::ALL which turns on all * The default value of \e caps is GeodesicLine::ALL.
the
* capabilities.
* *
* If the point is at a pole, the azimuth is defined by keeping the \e * If the point is at a pole, the azimuth is defined by keeping \e lon1
lon1 * fixed, writing \e lat1 = &plusmn;(90&deg; &minus; &epsilon;), and ta
* fixed and writing \e lat1 = &plusmn;(90&deg; &minus; &epsilon;) and king
* taking the limit &epsilon; &rarr; 0+. * the limit &epsilon; &rarr; 0+.
********************************************************************** / ********************************************************************** /
GeodesicLine(const Geodesic& g, real lat1, real lon1, real azi1, GeodesicLine(const Geodesic& g, real lat1, real lon1, real azi1,
unsigned caps = ALL) unsigned caps = ALL)
throw(); throw();
/** /**
* A default constructor. If GeodesicLine::Position is called on the * A default constructor. If GeodesicLine::Position is called on the
* resulting object, it returns immediately (without doing any * resulting object, it returns immediately (without doing any
* calculations). The object can be set with a call to Geodesic::Line. * calculations). The object can be set with a call to Geodesic::Line.
* Use Init() to test whether object is still in this uninitialized sta te. * Use Init() to test whether object is still in this uninitialized sta te.
skipping to change at line 487 skipping to change at line 487
* with \e caps |= GeodesicLine::GEODESICSCALE. * with \e caps |= GeodesicLine::GEODESICSCALE.
* @param[out] M21 geodesic scale of point 1 relative to point 2 * @param[out] M21 geodesic scale of point 1 relative to point 2
* (dimensionless); requires that the GeodesicLine object was constru cted * (dimensionless); requires that the GeodesicLine object was constru cted
* with \e caps |= GeodesicLine::GEODESICSCALE. * with \e caps |= GeodesicLine::GEODESICSCALE.
* @param[out] S12 area under the geodesic (meters<sup>2</sup>); requir es * @param[out] S12 area under the geodesic (meters<sup>2</sup>); requir es
* that the GeodesicLine object was constructed with \e caps |= * that the GeodesicLine object was constructed with \e caps |=
* GeodesicLine::AREA. * GeodesicLine::AREA.
* @return \e a12 arc length of between point 1 and point 2 (degrees). * @return \e a12 arc length of between point 1 and point 2 (degrees).
* *
* The GeodesicLine::mask values possible for \e outmask are * The GeodesicLine::mask values possible for \e outmask are
* - \e outmask |= GeodesicLine::LATITUDE for the latitude \e lat2. * - \e outmask |= GeodesicLine::LATITUDE for the latitude \e lat2;
* - \e outmask |= GeodesicLine::LONGITUDE for the latitude \e lon2. * - \e outmask |= GeodesicLine::LONGITUDE for the latitude \e lon2;
* - \e outmask |= GeodesicLine::AZIMUTH for the latitude \e azi2. * - \e outmask |= GeodesicLine::AZIMUTH for the latitude \e azi2;
* - \e outmask |= GeodesicLine::DISTANCE for the distance \e s12. * - \e outmask |= GeodesicLine::DISTANCE for the distance \e s12;
* - \e outmask |= GeodesicLine::REDUCEDLENGTH for the reduced length \ e * - \e outmask |= GeodesicLine::REDUCEDLENGTH for the reduced length \ e
* m12. * m12;
* - \e outmask |= GeodesicLine::GEODESICSCALE for the geodesic scales \e * - \e outmask |= GeodesicLine::GEODESICSCALE for the geodesic scales \e
* M12 and \e M21. * M12 and \e M21;
* - \e outmask |= GeodesicLine::AREA for the area \e S12. * - \e outmask |= GeodesicLine::AREA for the area \e S12;
* - \e outmask |= GeodesicLine::ALL for all of the above.
* . * .
* Requesting a value which the GeodesicLine object is not capable of * Requesting a value which the GeodesicLine object is not capable of
* computing is not an error; the corresponding argument will not be * computing is not an error; the corresponding argument will not be
* altered. Note, however, that the arc length is always computed and * altered. Note, however, that the arc length is always computed and
* returned as the function value. * returned as the function value.
********************************************************************** / ********************************************************************** /
Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask, Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask,
real& lat2, real& lon2, real& azi2, real& lat2, real& lon2, real& azi2,
real& s12, real& m12, real& M12, real& M21, real& s12, real& m12, real& M12, real& M21,
real& S12) const throw(); real& S12) const throw();
skipping to change at line 538 skipping to change at line 539
{ return Init() ? _lon1 : Math::NaN<real>(); } { return Init() ? _lon1 : Math::NaN<real>(); }
/** /**
* @return \e azi1 the azimuth (degrees) of the geodesic line at point 1. * @return \e azi1 the azimuth (degrees) of the geodesic line at point 1.
********************************************************************** / ********************************************************************** /
Math::real Azimuth() const throw() Math::real Azimuth() const throw()
{ return Init() ? _azi1 : Math::NaN<real>(); } { return Init() ? _azi1 : Math::NaN<real>(); }
/** /**
* @return \e azi0 the azimuth (degrees) of the geodesic line as it cro sses * @return \e azi0 the azimuth (degrees) of the geodesic line as it cro sses
* the equator in a northward direction. * the equator in a northward direction.
********************************************************************** / ********************************************************************** /
Math::real EquatorialAzimuth() const throw() { Math::real EquatorialAzimuth() const throw() {
return Init() ? return Init() ?
atan2(_salp0, _calp0) / Math::degree<real>() : Math::NaN<real>(); atan2(_salp0, _calp0) / Math::degree<real>() : Math::NaN<real>();
} }
/** /**
* @return \e a1 the arc length (degrees) between the northward equator ial * @return \e a1 the arc length (degrees) between the northward equator ial
* crossing and point 1. * crossing and point 1.
********************************************************************** / ********************************************************************** /
Math::real EquatorialArc() const throw() { Math::real EquatorialArc() const throw() {
return Init() ? return Init() ?
atan2(_ssig1, _csig1) / Math::degree<real>() : Math::NaN<real>(); atan2(_ssig1, _csig1) / Math::degree<real>() : Math::NaN<real>();
} }
/** /**
* @return \e a the equatorial radius of the ellipsoid (meters). This is * @return \e a the equatorial radius of the ellipsoid (meters). This is
* the value inherited from the Geodesic object used in the construct or. * the value inherited from the Geodesic object used in the construct or.
********************************************************************** / ********************************************************************** /
 End of changes. 13 change blocks. 
27 lines changed or deleted 27 lines changed or added


 GeodesicLineExact.hpp   GeodesicLineExact.hpp 
skipping to change at line 119 skipping to change at line 119
* Calculate geodesic scales \e M12 and \e M21. * Calculate geodesic scales \e M12 and \e M21.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
GEODESICSCALE = GeodesicExact::GEODESICSCALE, GEODESICSCALE = GeodesicExact::GEODESICSCALE,
/** /**
* Calculate area \e S12. * Calculate area \e S12.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
AREA = GeodesicExact::AREA, AREA = GeodesicExact::AREA,
/** /**
* All capabilities. Calculate everything. * All capabilities, calculate everything.
* @hideinitializer * @hideinitializer
******************************************************************** **/ ******************************************************************** **/
ALL = GeodesicExact::ALL, ALL = GeodesicExact::ALL,
}; };
/** \name Constructors /** \name Constructors
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
skipping to change at line 141 skipping to change at line 141
* \e lon1, and azimuth \e azi1 (all in degrees). * \e lon1, and azimuth \e azi1 (all in degrees).
* *
* @param[in] g A GeodesicExact object used to compute the necessary * @param[in] g A GeodesicExact object used to compute the necessary
* information about the GeodesicLineExact. * information about the GeodesicLineExact.
* @param[in] lat1 latitude of point 1 (degrees). * @param[in] lat1 latitude of point 1 (degrees).
* @param[in] lon1 longitude of point 1 (degrees). * @param[in] lon1 longitude of point 1 (degrees).
* @param[in] azi1 azimuth at point 1 (degrees). * @param[in] azi1 azimuth at point 1 (degrees).
* @param[in] caps bitor'ed combination of GeodesicLineExact::mask valu es * @param[in] caps bitor'ed combination of GeodesicLineExact::mask valu es
* specifying the capabilities the GeodesicLineExact object should * specifying the capabilities the GeodesicLineExact object should
* possess, i.e., which quantities can be returned in calls to * possess, i.e., which quantities can be returned in calls to
* GeodesicLib::Position. * GeodesicLine::Position.
* *
* \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e * \e lat1 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 an d \e
* azi1 should be in the range [&minus;540&deg;, 540&deg;). * azi1 should be in the range [&minus;540&deg;, 540&deg;).
* *
* The GeodesicLineExact::mask values are * The GeodesicLineExact::mask values are
* - \e caps |= GeodesicLineExact::LATITUDE for the latitude \e lat2; t his * - \e caps |= GeodesicLineExact::LATITUDE for the latitude \e lat2; t his
* is added automatically * is added automatically;
* - \e caps |= GeodesicLineExact::LONGITUDE for the latitude \e lon2 * - \e caps |= GeodesicLineExact::LONGITUDE for the latitude \e lon2;
* - \e caps |= GeodesicLineExact::AZIMUTH for the latitude \e azi2; th is is * - \e caps |= GeodesicLineExact::AZIMUTH for the latitude \e azi2; th is is
* added automatically * added automatically;
* - \e caps |= GeodesicLineExact::DISTANCE for the distance \e s12 * - \e caps |= GeodesicLineExact::DISTANCE for the distance \e s12;
* - \e caps |= GeodesicLineExact::REDUCEDLENGTH for the reduced length \e * - \e caps |= GeodesicLineExact::REDUCEDLENGTH for the reduced length \e
m12 m12;
* - \e caps |= GeodesicLineExact::GEODESICSCALE for the geodesic scale s \e * - \e caps |= GeodesicLineExact::GEODESICSCALE for the geodesic scale s \e
* M12 and \e M21 * M12 and \e M21;
* - \e caps |= GeodesicLineExact::AREA for the area \e S12 * - \e caps |= GeodesicLineExact::AREA for the area \e S12;
* - \e caps |= GeodesicLineExact::DISTANCE_IN permits the length of th e * - \e caps |= GeodesicLineExact::DISTANCE_IN permits the length of th e
* geodesic to be given in terms of \e s12; without this capability t he * geodesic to be given in terms of \e s12; without this capability t he
* length can only be specified in terms of arc length. * length can only be specified in terms of arc length;
* - \e caps |= GeodesicLineExact::ALL for all of the above.
* . * .
* The default value of \e caps is GeodesicLineExact::ALL which turns o * The default value of \e caps is GeodesicLineExact::ALL.
n
* all the capabilities.
* *
* If the point is at a pole, the azimuth is defined by keeping the \e * If the point is at a pole, the azimuth is defined by keeping \e lon1
lon1 * fixed, writing \e lat1 = &plusmn;(90&deg; &minus; &epsilon;), and ta
* fixed and writing \e lat1 = &plusmn;(90&deg; &minus; &epsilon;) and king
* taking the limit &epsilon; &rarr; 0+. * the limit &epsilon; &rarr; 0+.
********************************************************************** / ********************************************************************** /
GeodesicLineExact(const GeodesicExact& g, real lat1, real lon1, real az i1, GeodesicLineExact(const GeodesicExact& g, real lat1, real lon1, real az i1,
unsigned caps = ALL) unsigned caps = ALL)
throw(); throw();
/** /**
* A default constructor. If GeodesicLineExact::Position is called on the * A default constructor. If GeodesicLineExact::Position is called on the
* resulting object, it returns immediately (without doing any * resulting object, it returns immediately (without doing any
* calculations). The object can be set with a call to * calculations). The object can be set with a call to
* GeodesicExact::Line. Use Init() to test whether object is still in this * GeodesicExact::Line. Use Init() to test whether object is still in this
* uninitialized state. * uninitialized state.
********************************************************************** / ********************************************************************** /
GeodesicLineExact() throw() : _caps(0U) {} GeodesicLineExact() throw() : _caps(0U) {}
skipping to change at line 461 skipping to change at line 461
* constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE.
* @param[out] M21 geodesic scale of point 1 relative to point 2 * @param[out] M21 geodesic scale of point 1 relative to point 2
* (dimensionless); requires that the GeodesicLineExact object was * (dimensionless); requires that the GeodesicLineExact object was
* constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE.
* @param[out] S12 area under the geodesic (meters<sup>2</sup>); requir es * @param[out] S12 area under the geodesic (meters<sup>2</sup>); requir es
* that the GeodesicLineExact object was constructed with \e caps |= * that the GeodesicLineExact object was constructed with \e caps |=
* GeodesicLineExact::AREA. * GeodesicLineExact::AREA.
* @return \e a12 arc length of between point 1 and point 2 (degrees). * @return \e a12 arc length of between point 1 and point 2 (degrees).
* *
* The GeodesicLineExact::mask values possible for \e outmask are * The GeodesicLineExact::mask values possible for \e outmask are
* - \e outmask |= GeodesicLineExact::LATITUDE for the latitude \e lat2 * - \e outmask |= GeodesicLineExact::LATITUDE for the latitude \e lat2
. ;
* - \e outmask |= GeodesicLineExact::LONGITUDE for the latitude \e lon * - \e outmask |= GeodesicLineExact::LONGITUDE for the latitude \e lon
2. 2;
* - \e outmask |= GeodesicLineExact::AZIMUTH for the latitude \e azi2. * - \e outmask |= GeodesicLineExact::AZIMUTH for the latitude \e azi2;
* - \e outmask |= GeodesicLineExact::DISTANCE for the distance \e s12. * - \e outmask |= GeodesicLineExact::DISTANCE for the distance \e s12;
* - \e outmask |= GeodesicLineExact::REDUCEDLENGTH for the reduced len gth * - \e outmask |= GeodesicLineExact::REDUCEDLENGTH for the reduced len gth
* \e m12. * \e m12;
* - \e outmask |= GeodesicLineExact::GEODESICSCALE for the geodesic sc ales * - \e outmask |= GeodesicLineExact::GEODESICSCALE for the geodesic sc ales
* \e M12 and \e M21. * \e M12 and \e M21;
* - \e outmask |= GeodesicLineExact::AREA for the area \e S12. * - \e outmask |= GeodesicLineExact::AREA for the area \e S12;
* - \e outmask |= GeodesicLine::ALL for all of the above.
* . * .
* Requesting a value which the GeodesicLineExact object is not capable of * Requesting a value which the GeodesicLineExact object is not capable of
* computing is not an error; the corresponding argument will not be * computing is not an error; the corresponding argument will not be
* altered. Note, however, that the arc length is always computed and * altered. Note, however, that the arc length is always computed and
* returned as the function value. * returned as the function value.
********************************************************************** / ********************************************************************** /
Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask, Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask,
real& lat2, real& lon2, real& azi2, real& lat2, real& lon2, real& azi2,
real& s12, real& m12, real& M12, real& M21, real& s12, real& m12, real& M12, real& M21,
real& S12) const throw(); real& S12) const throw();
 End of changes. 13 change blocks. 
27 lines changed or deleted 27 lines changed or added


 GravityCircle.hpp   GravityCircle.hpp 
skipping to change at line 74 skipping to change at line 74
const CircularEngine& gravitational, const CircularEngine& gravitational,
const CircularEngine& disturbing, const CircularEngine& disturbing,
const CircularEngine& correction) const CircularEngine& correction)
: _caps(caps) : _caps(caps)
, _a(a) , _a(a)
, _f(f) , _f(f)
, _lat(lat) , _lat(lat)
, _h(h) , _h(h)
, _Z(Z) , _Z(Z)
, _Px(P) , _Px(P)
, _invR(Math::hypot(_Px, _Z)) , _invR(1 / Math::hypot(_Px, _Z))
, _cpsi(_Px * _invR) , _cpsi(_Px * _invR)
, _spsi(_Z * _invR) , _spsi(_Z * _invR)
, _cphi(cphi) , _cphi(cphi)
, _sphi(sphi) , _sphi(sphi)
, _amodel(amodel) , _amodel(amodel)
, _GMmodel(GMmodel) , _GMmodel(GMmodel)
, _dzonal0(dzonal0) , _dzonal0(dzonal0)
, _corrmult(corrmult) , _corrmult(corrmult)
, _gamma0(gamma0) , _gamma0(gamma0)
, _gamma(gamma) , _gamma(gamma)
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 LambertConformalConic.hpp   LambertConformalConic.hpp 
skipping to change at line 71 skipping to change at line 71
real _sign, _n, _nc, _t0nm1, _scale, _lat0, _k0; real _sign, _n, _nc, _t0nm1, _scale, _lat0, _k0;
real _scbet0, _tchi0, _scchi0, _psi0, _nrho0, _drhomax; real _scbet0, _tchi0, _scchi0, _psi0, _nrho0, _drhomax;
static const real eps_; static const real eps_;
static const real epsx_; static const real epsx_;
static const real tol_; static const real tol_;
static const real ahypover_; static const real ahypover_;
static const int numit_ = 5; static const int numit_ = 5;
static inline real hyp(real x) throw() { return Math::hypot(real(1), x) ; } static inline real hyp(real x) throw() { return Math::hypot(real(1), x) ; }
// e * atanh(e * x) = log( ((1 + e*x)/(1 - e*x))^(e/2) ) if f >= 0 // e * atanh(e * x) = log( ((1 + e*x)/(1 - e*x))^(e/2) ) if f >= 0
// - sqrt(-e2) * atan( sqrt(-e2) * x) if f < 0 // - sqrt(-e2) * atan( sqrt(-e2) * x) if f < 0
inline real eatanhe(real x) const throw() { inline real eatanhe(real x) const throw()
return _f >= 0 ? _e * Math::atanh(_e * x) : - _e * std::atan(_e * x); { return _f >= 0 ? _e * Math::atanh(_e * x) : - _e * std::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: W. M. Kahan and R. J. Fateman, // See:
// Symbolic computation of divided differences, // W. M. Kahan and R. J. Fateman,
// SIGSAM Bull. 33(3), 7-28 (1999) // Symbolic computation of divided differences,
// http://dx.doi.org/10.1145/334714.334716 // SIGSAM Bull. 33(3), 7-28 (1999)
// http://www.cs.berkeley.edu/~fateman/papers/divdiff.pdf // http://dx.doi.org/10.1145/334714.334716
// 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))
static inline real Dhyp(real x, real y, real hx, real hy) throw() static inline real Dhyp(real x, real y, real hx, real hy) throw()
 End of changes. 2 change blocks. 
8 lines changed or deleted 9 lines changed or added


 MGRS.hpp   MGRS.hpp 
skipping to change at line 97 skipping to change at line 97
utmrowperiod_ = 20, utmrowperiod_ = 20,
// Row letters are shifted by 5 for even zones // Row letters are shifted by 5 for even zones
utmevenrowshift_ = 5, utmevenrowshift_ = 5,
// Maximum precision is um // Maximum precision is um
maxprec_ = 5 + 6, maxprec_ = 5 + 6,
}; };
static void CheckCoords(bool utmp, bool& northp, real& x, real& y); static void CheckCoords(bool utmp, bool& northp, real& x, real& y);
static int UTMRow(int iband, int icol, int irow) throw(); static int UTMRow(int iband, int icol, int irow) throw();
friend class UTMUPS; // UTMUPS::StandardZone calls LatitudeBand friend class UTMUPS; // UTMUPS::StandardZone calls LatitudeBand
// Return latitude band number [-10, 10) for the give latitude (degrees ). // Return latitude band number [-10, 10) for the given latitude (degree s).
// The bands are reckoned in include their southern edges. // The bands are reckoned in include their southern edges.
static int LatitudeBand(real lat) throw() { static int LatitudeBand(real lat) throw() {
int ilat = int(std::floor(lat)); int ilat = int(std::floor(lat));
return (std::max)(-10, (std::min)(9, (ilat + 80)/8 - 10)); return (std::max)(-10, (std::min)(9, (ilat + 80)/8 - 10));
} }
// Return approximate latitude band number [-10, 10) for the given nort
hing
// (meters). With this rule, each 100km tile would have a unique band
// letter corresponding to the latitude at the center of the tile. Thi
s
// function isn't currently used.
static int ApproxLatitudeBand(real y) throw() {
// northing at tile center in units of tile = 100km
real ya = std::floor( std::min(real(88), std::abs(y/tile_)) ) + 0.5;
// convert to lat (mult by 90/100) and then to band (divide by 8)
// the +1 fine tunes the boundary between bands 3 and 4
int b = int(std::floor( ((ya * 9 + 1) / 10) / 8 ));
// For the northern hemisphere we have
// band rows num
// N 0 0:8 9
// P 1 9:17 9
// Q 2 18:26 9
// R 3 27:34 8
// S 4 35:43 9
// T 5 44:52 9
// U 6 53:61 9
// V 7 62:70 9
// W 8 71:79 9
// X 9 80:94 15
return y >= 0 ? b : -(b + 1);
}
// UTMUPS access these enums // UTMUPS access these enums
enum { enum {
tile_ = 100000, // Size MGRS blocks tile_ = 100000, // Size MGRS blocks
minutmcol_ = 1, minutmcol_ = 1,
maxutmcol_ = 9, maxutmcol_ = 9,
minutmSrow_ = 10, minutmSrow_ = 10,
maxutmSrow_ = 100, // Also used for UTM S false northing maxutmSrow_ = 100, // Also used for UTM S false northing
minutmNrow_ = 0, // Also used for UTM N false northing minutmNrow_ = 0, // Also used for UTM N false northing
maxutmNrow_ = 95, maxutmNrow_ = 95,
minupsSind_ = 8, // These 4 ind's apply to easting and nort hing minupsSind_ = 8, // These 4 ind's apply to easting and nort hing
 End of changes. 2 change blocks. 
1 lines changed or deleted 27 lines changed or added


 Math.hpp   Math.hpp 
skipping to change at line 160 skipping to change at line 160
#if defined(DOXYGEN) #if defined(DOXYGEN)
/** /**
* The hypotenuse function avoiding underflow and overflow. * The hypotenuse function avoiding underflow and overflow.
* *
* @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
* @return sqrt(<i>x</i><sup>2</sup> + <i>y</i><sup>2</sup>). * @return sqrt(<i>x</i><sup>2</sup> + <i>y</i><sup>2</sup>).
********************************************************************** / ********************************************************************** /
template<typename T> static inline T hypot(T x, T y) throw() { template<typename T> static inline T hypot(T x, T y) throw() {
x = std::abs(x); x = std::abs(x); y = std::abs(y);
y = std::abs(y); T a = (std::max)(x, y), b = (std::min)(x, y) / (a ? a : 1);
T a = (std::max)(x, y),
b = (std::min)(x, y) / (a ? a : 1);
return a * std::sqrt(1 + b * b); return a * std::sqrt(1 + b * b);
// For an alternative method see
// C. Moler and D. Morrision (1983) http://dx.doi.org/10.1147/rd.276.
0577
// and A. A. Dubrulle (1983) http://dx.doi.org/10.1147/rd.276.0582
} }
#elif GEOGRAPHICLIB_CPLUSPLUS11_MATH #elif GEOGRAPHICLIB_CPLUSPLUS11_MATH
template<typename T> static inline T hypot(T x, T y) throw() template<typename T> static inline T hypot(T x, T y) throw()
{ return std::hypot(x, y); } { return std::hypot(x, y); }
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
static inline double hypot(double x, double y) throw() static inline double hypot(double x, double y) throw()
{ return _hypot(x, y); } { return _hypot(x, y); }
# if _MSC_VER < 1400 # if _MSC_VER < 1400
// Visual C++ 7.1/VS .NET 2003 does not have _hypotf() // Visual C++ 7.1/VS .NET 2003 does not have _hypotf()
static inline float hypot(float x, float y) throw() static inline float hypot(float x, float y) throw()
skipping to change at line 369 skipping to change at line 370
// u + v = s + t // u + v = s + t
// = round(u + v) + t // = round(u + v) + t
return s; return s;
} }
/** /**
* Normalize an angle (restricted input range). * Normalize an angle (restricted input range).
* *
* @tparam T the type of the argument and returned value. * @tparam T the type of the argument and returned value.
* @param[in] x the angle in degrees. * @param[in] x the angle in degrees.
* @return the angle reduced to the range [&minus;180&deg;, * @return the angle reduced to the range [&minus;180&deg;, 180&deg;).
* 180&deg;).
* *
* \e x must lie in [&minus;540&deg;, 540&deg;). * \e x must lie in [&minus;540&deg;, 540&deg;).
********************************************************************** / ********************************************************************** /
template<typename T> static inline T AngNormalize(T x) throw() template<typename T> static inline T AngNormalize(T x) throw()
{ return x >= 180 ? x - 360 : (x < -180 ? x + 360 : x); } { return x >= 180 ? x - 360 : (x < -180 ? x + 360 : x); }
/** /**
* Normalize an arbitrary angle. * Normalize an arbitrary angle.
* *
* @tparam T the type of the argument and returned value. * @tparam T the type of the argument and returned value.
* @param[in] x the angle in degrees. * @param[in] x the angle in degrees.
* @return the angle reduced to the range [&minus;180&deg;, * @return the angle reduced to the range [&minus;180&deg;, 180&deg;).
* 180&deg;).
* *
* The range of \e x is unrestricted. * The range of \e x is unrestricted.
********************************************************************** / ********************************************************************** /
template<typename T> static inline T AngNormalize2(T x) throw() template<typename T> static inline T AngNormalize2(T x) throw()
{ return AngNormalize<T>(std::fmod(x, T(360))); } { return AngNormalize<T>(std::fmod(x, T(360))); }
/** /**
* Difference of two angles reduced to [&minus;180&deg;, 180&deg;] * Difference of two angles reduced to [&minus;180&deg;, 180&deg;]
* *
* @tparam T the type of the arguments and returned value. * @tparam T the type of the arguments and returned value.
 End of changes. 4 change blocks. 
8 lines changed or deleted 8 lines changed or added


 OSGB.hpp   OSGB.hpp 
skipping to change at line 244 skipping to change at line 244
///@} ///@}
}; };
} // namespace GeographicLib } // namespace GeographicLib
#if defined(_MSC_VER) #if defined(_MSC_VER)
# pragma warning (pop) # pragma warning (pop)
#endif #endif
#endif #endif // GEOGRAPHICLIB_OSGB_HPP
 End of changes. 1 change blocks. 
0 lines changed or deleted 0 lines changed or added


 PolarStereographic.hpp   PolarStereographic.hpp 
skipping to change at line 49 skipping to change at line 49
static const real overflow_; static const real overflow_;
static const int numit_ = 5; static const int numit_ = 5;
// tan(x) for x in [-pi/2, pi/2] ensuring that the sign is right // tan(x) for x in [-pi/2, pi/2] ensuring that the sign is right
static inline real tanx(real x) throw() { static inline real tanx(real x) throw() {
real t = std::tan(x); real t = std::tan(x);
// Write the tests this way to ensure that tanx(NaN()) is NaN() // Write the tests this way to ensure that tanx(NaN()) is NaN()
return x >= 0 ? (!(t < 0) ? t : overflow_) : (!(t >= 0) ? t : -overfl ow_); return x >= 0 ? (!(t < 0) ? t : overflow_) : (!(t >= 0) ? t : -overfl ow_);
} }
// Return e * atanh(e * x) for f >= 0, else return // Return e * atanh(e * x) for f >= 0, else return
// - sqrt(-e2) * atan( sqrt(-e2) * x) for f < 0 // - sqrt(-e2) * atan( sqrt(-e2) * x) for f < 0
inline real eatanhe(real x) const throw() { inline real eatanhe(real x) const throw()
return _f >= 0 ? _e * Math::atanh(_e * x) : - _e * std::atan(_e * x); { return _f >= 0 ? _e * Math::atanh(_e * x) : - _e * std::atan(_e * x);
} }
public: public:
/** /**
* 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.
* Negative \e f gives a prolate ellipsoid. If \e f > 1, set flatten ing * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flatten ing
* to 1/\e f. * to 1/\e f.
* @param[in] k0 central scale factor. * @param[in] k0 central scale factor.
 End of changes. 1 change blocks. 
3 lines changed or deleted 3 lines changed or added


 PolygonArea.hpp   PolygonArea.hpp 
skipping to change at line 58 skipping to change at line 58
private: private:
typedef Math::real real; typedef Math::real real;
Geodesic _earth; Geodesic _earth;
real _area0; // Full ellipsoid area real _area0; // Full ellipsoid area
bool _polyline; // Assume polyline (don't close and skip ar ea) bool _polyline; // Assume polyline (don't close and skip ar ea)
unsigned _mask; unsigned _mask;
unsigned _num; unsigned _num;
int _crossings; int _crossings;
Accumulator<real> _areasum, _perimetersum; Accumulator<real> _areasum, _perimetersum;
real _lat0, _lon0, _lat1, _lon1; real _lat0, _lon0, _lat1, _lon1;
static inline int transit(real lon1, real lon2) { static inline int transit(real lon1, real lon2) throw() {
// Return 1 or -1 if crossing prime meridian in east or west directio n. // Return 1 or -1 if crossing prime meridian in east or west directio n.
// Otherwise return zero. // Otherwise return zero.
// Compute lon12 the same way as Geodesic::Inverse. // Compute lon12 the same way as Geodesic::Inverse.
lon1 = Math::AngNormalize(lon1); lon1 = Math::AngNormalize(lon1);
lon2 = Math::AngNormalize(lon2); lon2 = Math::AngNormalize(lon2);
real lon12 = Math::AngDiff(lon1, lon2); real lon12 = Math::AngDiff(lon1, lon2);
int cross = int cross =
lon1 < 0 && lon2 >= 0 && lon12 > 0 ? 1 : lon1 < 0 && lon2 >= 0 && lon12 > 0 ? 1 :
(lon2 < 0 && lon1 >= 0 && lon12 < 0 ? -1 : 0); (lon2 < 0 && lon1 >= 0 && lon12 < 0 ? -1 : 0);
return cross; return cross;
skipping to change at line 84 skipping to change at line 84
* *
* @param[in] earth the Geodesic object to use for geodesic calculation s. * @param[in] earth the Geodesic object to use for geodesic calculation s.
* By default this uses the WGS84 ellipsoid. * By default this uses the WGS84 ellipsoid.
* @param[in] polyline if true that treat the points as defining a poly line * @param[in] polyline if true that treat the points as defining a poly line
* instead of a polygon (default = false). * instead of a polygon (default = false).
********************************************************************** / ********************************************************************** /
PolygonArea(const Geodesic& earth, bool polyline = false) throw() PolygonArea(const Geodesic& earth, bool polyline = false) throw()
: _earth(earth) : _earth(earth)
, _area0(_earth.EllipsoidArea()) , _area0(_earth.EllipsoidArea())
, _polyline(polyline) , _polyline(polyline)
, _mask(Geodesic::LATITUDE | Geodesic::LONGITUDE | , _mask(Geodesic::LATITUDE | Geodesic::LONGITUDE | Geodesic::DISTANCE
Geodesic::DISTANCE | (_polyline ? 0 : Geodesic::AREA)) |
(_polyline ? Geodesic::NONE : Geodesic::AREA))
{ Clear(); } { Clear(); }
/** /**
* Clear PolygonArea, allowing a new polygon to be started. * Clear PolygonArea, allowing a new polygon to be started.
********************************************************************** / ********************************************************************** /
void Clear() throw() { void Clear() throw() {
_num = 0; _num = 0;
_crossings = 0; _crossings = 0;
_areasum = 0; _areasum = 0;
_perimetersum = 0; _perimetersum = 0;
_lat0 = _lon0 = _lat1 = _lon1 = Math::NaN<real>(); _lat0 = _lon0 = _lat1 = _lon1 = Math::NaN<real>();
} }
/** /**
* Add a point to the polygon or polyline. * Add a point to the polygon or polyline.
* *
* @param[in] lat the latitude of the point (degrees). * @param[in] lat the latitude of the point (degrees).
* @param[in] lon the latitude of the point (degrees). * @param[in] lon the longitude of the point (degrees).
* *
* \e lat should be in the range [&minus;90&deg;, 90&deg;] and \e * \e lat should be in the range [&minus;90&deg;, 90&deg;] and \e
* lon should be in the range [&minus;540&deg;, 540&deg;). * lon should be in the range [&minus;540&deg;, 540&deg;).
********************************************************************** / ********************************************************************** /
void AddPoint(real lat, real lon) throw(); void AddPoint(real lat, real lon) throw();
/** /**
* Add an edge to the polygon or polyline. * Add an edge to the polygon or polyline.
* *
* @param[in] azi azimuth at current point (degrees). * @param[in] azi azimuth at current point (degrees).
skipping to change at line 133 skipping to change at line 133
* Return the results so far. * Return the results so far.
* *
* @param[in] reverse if true then clockwise (instead of counter-clockw ise) * @param[in] reverse if true then clockwise (instead of counter-clockw ise)
* traversal counts as a positive area. * traversal counts as a positive area.
* @param[in] sign if true then return a signed result for the area if * @param[in] sign if true then return a signed result for the area if
* the polygon is traversed in the "wrong" direction instead of retur ning * the polygon is traversed in the "wrong" direction instead of retur ning
* the area for the rest of the earth. * the area for the rest of the earth.
* @param[out] perimeter the perimeter of the polygon or length of the * @param[out] perimeter the perimeter of the polygon or length of the
* polyline (meters). * polyline (meters).
* @param[out] area the area of the polygon (meters<sup>2</sup>); only set * @param[out] area the area of the polygon (meters<sup>2</sup>); only set
* if polyline is false in the constructor. * if \e polyline is false in the constructor.
* @return the number of points. * @return the number of points.
********************************************************************** / ********************************************************************** /
unsigned Compute(bool reverse, bool sign, unsigned Compute(bool reverse, bool sign,
real& perimeter, real& area) const throw(); real& perimeter, real& area) const throw();
/** /**
* Return the results assuming a tentative final test point is added; * Return the results assuming a tentative final test point is added;
* however, the data for the test point is not saved. This lets you re port * however, the data for the test point is not saved. This lets you re port
* a running result for the perimeter and area as the user moves the mo use * a running result for the perimeter and area as the user moves the mo use
* cursor. Ordinary floating point arithmetic is used to accumulate th e * cursor. Ordinary floating point arithmetic is used to accumulate th e
skipping to change at line 194 skipping to change at line 194
* @param[out] area the approximate area of the polygon * @param[out] area the approximate area of the polygon
* (meters<sup>2</sup>); only set if polyline is false in the * (meters<sup>2</sup>); only set if polyline is false in the
* constructor. * constructor.
* @return the number of points. * @return the number of points.
* *
* \e azi should be in the range [&minus;540&deg;, 540&deg;). * \e azi should be in the range [&minus;540&deg;, 540&deg;).
********************************************************************** / ********************************************************************** /
unsigned TestEdge(real azi, real s, bool reverse, bool sign, unsigned TestEdge(real azi, real s, bool reverse, bool sign,
real& perimeter, real& area) const throw(); real& perimeter, real& area) const throw();
/// \cond SKIP
/** /**
* <b>DEPRECATED</b> * <b>DEPRECATED</b>
* The old name for PolygonArea::TestPoint. * The old name for PolygonArea::TestPoint.
********************************************************************** / ********************************************************************** /
unsigned TestCompute(real lat, real lon, bool reverse, bool sign, unsigned TestCompute(real lat, real lon, bool reverse, bool sign,
real& perimeter, real& area) const throw(); real& perimeter, real& area) const throw() {
return TestPoint(lat, lon, reverse, sign, perimeter, area);
}
/// \endcond
/** \name Inspector functions /** \name Inspector functions
********************************************************************** / ********************************************************************** /
///@{ ///@{
/** /**
* @return \e a the equatorial radius of the ellipsoid (meters). This is * @return \e a the equatorial radius of the ellipsoid (meters). This is
* the value inherited from the Geodesic object used in the construct or. * the value inherited from the Geodesic object used in the construct or.
********************************************************************** / ********************************************************************** /
Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } Math::real MajorRadius() const throw() { return _earth.MajorRadius(); }
skipping to change at line 221 skipping to change at line 225
/** /**
* @return \e f the flattening of the ellipsoid. This is the value * @return \e f the flattening of the ellipsoid. This is the value
* inherited from the Geodesic object used in the constructor. * inherited from the Geodesic object used in the constructor.
********************************************************************** / ********************************************************************** /
Math::real Flattening() const throw() { return _earth.Flattening(); } Math::real Flattening() const throw() { return _earth.Flattening(); }
/** /**
* Report the previous vertex added to the polygon or polyline. * Report the previous vertex added to the polygon or polyline.
* *
* @param[out] lat the latitude of the point (degrees). * @param[out] lat the latitude of the point (degrees).
* @param[out] lon the latitude of the point (degrees). * @param[out] lon the longitude of the point (degrees).
* *
* If no points have been added, then NaNs are returned. Otherwise, \e lon * If no points have been added, then NaNs are returned. Otherwise, \e lon
* will be in the range [&minus;180&deg;, 180&deg;). * will be in the range [&minus;180&deg;, 180&deg;).
********************************************************************** / ********************************************************************** /
void CurrentPoint(real& lat, real& lon) const throw() void CurrentPoint(real& lat, real& lon) const throw()
{ lat = _lat1; lon = _lon1; } { lat = _lat1; lon = _lon1; }
///@} ///@}
}; };
} // namespace GeographicLib } // namespace GeographicLib
 End of changes. 7 change blocks. 
7 lines changed or deleted 12 lines changed or added


 TransverseMercator.hpp   TransverseMercator.hpp 
skipping to change at line 97 skipping to change at line 97
// _alp[0] and _bet[0] unused // _alp[0] and _bet[0] unused
real _a1, _b1, _alp[maxpow_ + 1], _bet[maxpow_ + 1]; real _a1, _b1, _alp[maxpow_ + 1], _bet[maxpow_ + 1];
// tan(x) for x in [-pi/2, pi/2] ensuring that the sign is right // tan(x) for x in [-pi/2, pi/2] ensuring that the sign is right
static inline real tanx(real x) throw() { static inline real tanx(real x) throw() {
real t = std::tan(x); real t = std::tan(x);
// Write the tests this way to ensure that tanx(NaN()) is NaN() // Write the tests this way to ensure that tanx(NaN()) is NaN()
return x >= 0 ? (!(t < 0) ? t : overflow_) : (!(t >= 0) ? t : -overfl ow_); return x >= 0 ? (!(t < 0) ? t : overflow_) : (!(t >= 0) ? t : -overfl ow_);
} }
// Return e * atanh(e * x) for f >= 0, else return // Return e * atanh(e * x) for f >= 0, else return
// - sqrt(-e2) * atan( sqrt(-e2) * x) for f < 0 // - sqrt(-e2) * atan( sqrt(-e2) * x) for f < 0
inline real eatanhe(real x) const throw() { inline real eatanhe(real x) const throw()
return _f >= 0 ? _e * Math::atanh(_e * x) : - _e * std::atan(_e * x); { return _f >= 0 ? _e * Math::atanh(_e * x) : - _e * std::atan(_e * x);
} }
real taupf(real tau) const throw(); real taupf(real tau) const throw();
real tauf(real taup) const throw(); real tauf(real taup) const throw();
friend class Ellipsoid; // For access to taupf, tauf. friend class Ellipsoid; // For access to taupf, tauf.
public: public:
/** /**
* Constructor for a ellipsoid with * Constructor for a ellipsoid with
* *
* @param[in] a equatorial radius (meters). * @param[in] a equatorial radius (meters).
 End of changes. 1 change blocks. 
3 lines changed or deleted 3 lines changed or added


 UTMUPS.hpp   UTMUPS.hpp 
skipping to change at line 304 skipping to change at line 304
* allowed ranges (see UTMUPS::Reverse). * allowed ranges (see UTMUPS::Reverse).
* *
* \e zonein must be in the range [UTMUPS::MINZONE, UTMUPS::MAXZONE] = [0, * \e zonein must be in the range [UTMUPS::MINZONE, UTMUPS::MAXZONE] = [0,
* 60] with \e zonein = UTMUPS::UPS, 0, indicating UPS. \e zonein may * 60] with \e zonein = UTMUPS::UPS, 0, indicating UPS. \e zonein may
* also be UTMUPS::INVALID. * also be UTMUPS::INVALID.
* *
* \e zoneout must be in the range [UTMUPS::MINPSEUDOZONE, UTMUPS::MAXZ ONE] * \e zoneout must be in the range [UTMUPS::MINPSEUDOZONE, UTMUPS::MAXZ ONE]
* = [-4, 60]. If \e zoneout &lt; UTMUPS::MINZONE then the rules give in * = [-4, 60]. If \e zoneout &lt; UTMUPS::MINZONE then the rules give in
* the documentation of UTMUPS::zonespec are applied, and \e zone is se t to * the documentation of UTMUPS::zonespec are applied, and \e zone is se t to
* the actual zone used for output. * the actual zone used for output.
*
* (\e xout, \e yout) can overlap with (\e xin, \e yin).
********************************************************************** / ********************************************************************** /
static void Transfer(int zonein, bool northpin, real xin, real yin, static void Transfer(int zonein, bool northpin, real xin, real yin,
int zoneout, bool northpout, real& xout, real& you t, int zoneout, bool northpout, real& xout, real& you t,
int& zone); int& zone);
/** /**
* Decode a UTM/UPS zone string. * Decode a UTM/UPS zone string.
* *
* @param[in] zonestr string representation of zone and hemisphere. * @param[in] zonestr string representation of zone and hemisphere.
* @param[out] zone the UTM zone (zero means UPS). * @param[out] zone the UTM zone (zero means UPS).
skipping to change at line 358 skipping to change at line 360
* @param[in] epsg the EPSG code. * @param[in] epsg the EPSG code.
* @param[out] zone the UTM zone (zero means UPS). * @param[out] zone the UTM zone (zero means UPS).
* @param[out] northp hemisphere (true means north, false means south). * @param[out] northp hemisphere (true means north, false means south).
* *
* EPSG (European Petroleum Survery Group) codes are a way to refer to many * EPSG (European Petroleum Survery Group) codes are a way to refer to many
* different projections. DecodeEPSG decodes those refering to UTM or UPS * different projections. DecodeEPSG decodes those refering to UTM or UPS
* projections for the WGS84 ellipsoid. If the code does not refer to one * projections for the WGS84 ellipsoid. If the code does not refer to one
* of these projections, \e zone is set to UTMUPS::INVALID. See * of these projections, \e zone is set to UTMUPS::INVALID. See
* http://spatialreference.org/ref/epsg/ * http://spatialreference.org/ref/epsg/
********************************************************************** / ********************************************************************** /
static void DecodeEPSG(int& epsg, int& zone, bool& northp) throw(); static void DecodeEPSG(int epsg, int& zone, bool& northp) throw();
/** /**
* Encode zone as EPSG. * Encode zone as EPSG.
* *
* @param[in] zone the UTM zone (zero means UPS). * @param[in] zone the UTM zone (zero means UPS).
* @param[in] northp hemisphere (true means north, false means south). * @param[in] northp hemisphere (true means north, false means south).
* @return EPSG code (or -1 if \e zone is not in the range * @return EPSG code (or -1 if \e zone is not in the range
* [UTMUPS::MINZONE, UTMUPS::MAXZONE] = [0, 60]) * [UTMUPS::MINZONE, UTMUPS::MAXZONE] = [0, 60])
* *
* Convert \e zone and \e northp to the corresponding EPSG (European * Convert \e zone and \e northp to the corresponding EPSG (European
 End of changes. 2 change blocks. 
1 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/