CassiniSoldner.hpp   CassiniSoldner.hpp 
skipping to change at line 12 skipping to change at line 12
* \file CassiniSoldner.hpp * \file CassiniSoldner.hpp
* \brief Header for GeographicLib::CassiniSoldner class * \brief Header for GeographicLib::CassiniSoldner class
* *
* Copyright (c) Charles Karney (2009, 2010, 2011) <charles@karney.com> and * Copyright (c) Charles Karney (2009, 2010, 2011) <charles@karney.com> and
* licensed under the MIT/X11 License. For more information, see * licensed under the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_CASSINISOLDNER_HPP) #if !defined(GEOGRAPHICLIB_CASSINISOLDNER_HPP)
#define GEOGRAPHICLIB_CASSINISOLDNER_HPP \ #define GEOGRAPHICLIB_CASSINISOLDNER_HPP \
"$Id: 5e164482237fc52a63dda3d7e4f287f6313fc79a $" "$Id: 5bc26e8f1b01bf50e377db0d9c140721f13dc834 $"
#include <GeographicLib/Geodesic.hpp> #include <GeographicLib/Geodesic.hpp>
#include <GeographicLib/GeodesicLine.hpp> #include <GeographicLib/GeodesicLine.hpp>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief Cassini-Soldner Projection. * \brief Cassini-Soldner Projection.
* *
skipping to change at line 74 skipping to change at line 74
**********************************************************************/ **********************************************************************/
class GEOGRAPHIC_EXPORT CassiniSoldner { class GEOGRAPHIC_EXPORT CassiniSoldner {
private: private:
typedef Math::real real; typedef Math::real real;
Geodesic _earth; Geodesic _earth;
GeodesicLine _meridian; GeodesicLine _meridian;
real _sbet0, _cbet0; real _sbet0, _cbet0;
static const real eps1_; static const real eps1_;
static const real tiny_; static const real tiny_;
static const unsigned maxit_ = 10; static const unsigned maxit_ = 10;
// The following private helper functions are copied from Geodesic. // The following private helper functions are copied from Geodesic.
static inline real AngNormalize(real x) throw() { static inline real AngNormalize(real x) throw() {
// Place angle in [-180, 180). Assumes x is in [-540, 540). // Place angle in [-180, 180). Assumes x is in [-540, 540).
return x >= 180 ? x - 360 : (x < -180 ? x + 360 : x); return x >= 180 ? x - 360 : (x < -180 ? x + 360 : x);
} }
static inline real AngRound(real x) throw() { static inline real AngRound(real x) throw() {
// The makes the smallest gap in x = 1/16 - nextafter(1/16, 0) = 1/2^ 57 // The makes the smallest gap in x = 1/16 - nextafter(1/16, 0) = 1/2^ 57
// for reals = 0.7 pm on the earth if x is an angle in degrees. (Thi s // for reals = 0.7 pm on the earth if x is an angle in degrees. (Thi s
// is about 1000 times more resolution than we get with angles around 90 // is about 1000 times more resolution than we get with angles around 90
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 Config.h   Config.h 
#define HAVE_LONG_DOUBLE 1 #define HAVE_LONG_DOUBLE 1
#define GEOGRAPHICLIB_VERSION_STRING "1.18" #define GEOGRAPHICLIB_VERSION_STRING "1.19"
/* # undef WORDS_BIGENDIAN */ /* # undef WORDS_BIGENDIAN */
 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 12 skipping to change at line 12
* \file LambertConformalConic.hpp * \file LambertConformalConic.hpp
* \brief Header for GeographicLib::LambertConformalConic class * \brief Header for GeographicLib::LambertConformalConic class
* *
* Copyright (c) Charles Karney (2010, 2011) <charles@karney.com> and licen sed * Copyright (c) Charles Karney (2010, 2011) <charles@karney.com> and licen sed
* under the MIT/X11 License. For more information, see * under the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP) #if !defined(GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP)
#define GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP \ #define GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP \
"$Id: fcf9176f0a356995138754581297173aa3491693 $" "$Id: 01a4aff302dde6b1dca687badd42f945f34b9bf7 $"
#include <algorithm> #include <algorithm>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
namespace GeographicLib { namespace GeographicLib {
/** /**
* \brief Lambert Conformal Conic Projection * \brief Lambert Conformal Conic Projection
* *
* Implementation taken from the report, * Implementation taken from the report,
skipping to change at line 115 skipping to change at line 115
real t = (x - y)/2; real t = (x - y)/2;
return (t != 0 ? sinh(t)/t : real(1)) * exp((x + y)/2); return (t != 0 ? sinh(t)/t : real(1)) * exp((x + y)/2);
} }
// Dsinh(x,y) = 2*sinh((x-y)/2)/(x-y) * cosh((x+y)/2) // Dsinh(x,y) = 2*sinh((x-y)/2)/(x-y) * cosh((x+y)/2)
// cosh((x+y)/2) = (c+sinh(x)*sinh(y)/c)/2 // cosh((x+y)/2) = (c+sinh(x)*sinh(y)/c)/2
// c=sqrt((1+cosh(x))*(1+cosh(y))) // c=sqrt((1+cosh(x))*(1+cosh(y)))
// cosh((x+y)/2) = sqrt( (sinh(x)*sinh(y) + cosh(x)*cosh(y) + 1)/2 ) // cosh((x+y)/2) = sqrt( (sinh(x)*sinh(y) + cosh(x)*cosh(y) + 1)/2 )
static inline real Dsinh(real x, real y, real sx, real sy, real cx, rea l cy) static inline real Dsinh(real x, real y, real sx, real sy, real cx, rea l cy)
// sx = sinh(x), cx = cosh(x) // sx = sinh(x), cx = cosh(x)
throw() { throw() {
// real t = (x - y)/2, c = sqrt((1 + cx) * (1 + cy)); // real t = (x - y)/2, c = sqrt((1 + cx) * (1 + cy));
// return (t != 0 ? sinh(t)/t : real(1)) * (c + sx * sy / c) /2; // return (t != 0 ? sinh(t)/t : real(1)) * (c + sx * sy / c) /2;
real t = (x - y)/2; real t = (x - y)/2;
return (t != 0 ? sinh(t)/t : real(1)) * sqrt((sx * sy + cx * cy + 1) /2); return (t != 0 ? sinh(t)/t : real(1)) * sqrt((sx * sy + cx * cy + 1) /2);
} }
// Dasinh(x,y) = asinh((x-y)*(x+y)/(x*sqrt(1+y^2)+y*sqrt(1+x^2)))/(x-y) // Dasinh(x,y) = asinh((x-y)*(x+y)/(x*sqrt(1+y^2)+y*sqrt(1+x^2)))/(x-y)
// = asinh((x*sqrt(1+y^2)-y*sqrt(1+x^2)))/(x-y) // = asinh((x*sqrt(1+y^2)-y*sqrt(1+x^2)))/(x-y)
static inline real Dasinh(real x, real y, real hx, real hy) throw() { static inline real Dasinh(real x, real y, real hx, real hy) throw() {
// hx = hyp(x) // hx = hyp(x)
real t = x - y; real t = x - y;
return t != 0 ? return t != 0 ?
Math::asinh(x*y > 0 ? t * (x+y) / (x*hy + y*hx) : x*hy - y*hx) / t : Math::asinh(x*y > 0 ? t * (x+y) / (x*hy + y*hx) : x*hy - y*hx) / t :
1/hx; 1/hx;
skipping to change at line 284 skipping to change at line 284
/** \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 used in the constructor. * the value used in the constructor.
********************************************************************** / ********************************************************************** /
Math::real MajorRadius() const throw() { return _a; } Math::real MajorRadius() const throw() { return _a; }
/** /**
* @return \e f the flattening of the ellipsoid. This is the * @return \e f the flattening of the ellipsoid. This is the
* value used in the constructor. * value used in the constructor.
********************************************************************** / ********************************************************************** /
Math::real Flattening() const throw() { return _f; } Math::real Flattening() const throw() { return _f; }
/** /**
* <b>DEPRECATED</b> * <b>DEPRECATED</b>
* @return \e r the inverse flattening of the ellipsoid. * @return \e r the inverse flattening of the ellipsoid.
********************************************************************** / ********************************************************************** /
Math::real InverseFlattening() const throw() { return 1/_f; } Math::real InverseFlattening() const throw() { return 1/_f; }
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added


 Math.hpp   Math.hpp 
skipping to change at line 15 skipping to change at line 15
* Copyright (c) Charles Karney (2008, 2009, 2010, 2011) <charles@karney.co m> * Copyright (c) Charles Karney (2008, 2009, 2010, 2011) <charles@karney.co m>
* and licensed under the MIT/X11 License. For more information, see * and licensed under the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
// Constants.hpp includes Math.hpp. Place this include outside Math.hpp's // Constants.hpp includes Math.hpp. Place this include outside Math.hpp's
// include guard to enforce this ordering. // include guard to enforce this ordering.
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#if !defined(GEOGRAPHICLIB_MATH_HPP) #if !defined(GEOGRAPHICLIB_MATH_HPP)
#define GEOGRAPHICLIB_MATH_HPP "$Id: 045fb188fcc3fe808fed0c9d5fa965861d2735 d1 $" #define GEOGRAPHICLIB_MATH_HPP "$Id: f0c40ff3ed056d8a0a110725be4528be4a4a6a 6e $"
/** /**
* Are C++0X math functions available? * Are C++0X math functions available?
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_CPLUSPLUS0X_MATH) #if !defined(GEOGRAPHICLIB_CPLUSPLUS0X_MATH)
# if defined(__GXX_EXPERIMENTAL_CXX0X__) # if defined(__GXX_EXPERIMENTAL_CXX0X__)
# define GEOGRAPHICLIB_CPLUSPLUS0X_MATH 1 # define GEOGRAPHICLIB_CPLUSPLUS0X_MATH 1
# else # else
# define GEOGRAPHICLIB_CPLUSPLUS0X_MATH 0 # define GEOGRAPHICLIB_CPLUSPLUS0X_MATH 0
# endif # endif
skipping to change at line 197 skipping to change at line 197
* @return exp(\e x) - 1. * @return exp(\e x) - 1.
********************************************************************** / ********************************************************************** /
template<typename T> static inline T expm1(T x) throw() { template<typename T> static inline T expm1(T x) throw() {
volatile T volatile T
y = std::exp(x), y = std::exp(x),
z = y - 1; z = y - 1;
// The reasoning here is similar to that for log1p. The expression // The reasoning here is similar to that for log1p. The expression
// mathematically reduces to exp(x) - 1, and the factor z/log(y) = (y - // mathematically reduces to exp(x) - 1, and the factor z/log(y) = (y -
// 1)/log(y) is a slowly varying quantity near y = 1 and is accuratel y // 1)/log(y) is a slowly varying quantity near y = 1 and is accuratel y
// computed. // computed.
return std::abs(x) > 1 ? z : (z == 0 ? x : x * z / std::log(y)); return std::abs(x) > 1 ? z : (z == 0 ? x : x * z / std::log(y));
} }
#elif GEOGRAPHICLIB_CPLUSPLUS0X_MATH #elif GEOGRAPHICLIB_CPLUSPLUS0X_MATH
template<typename T> static inline T expm1(T x) throw() template<typename T> static inline T expm1(T x) throw()
{ return std::expm1(x); } { return std::expm1(x); }
#else #else
static inline double expm1(double x) throw() { return ::expm1(x); } static inline double expm1(double x) throw() { return ::expm1(x); }
static inline float expm1(float x) throw() { return ::expm1f(x); } static inline float expm1(float x) throw() { return ::expm1f(x); }
#if defined(HAVE_LONG_DOUBLE) #if defined(HAVE_LONG_DOUBLE)
static inline long double expm1(long double x) throw() static inline long double expm1(long double x) throw()
{ return ::expm1l(x); } { return ::expm1l(x); }
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 OSGB.hpp   OSGB.hpp 
/** /**
* \file OSGB.hpp * \file OSGB.hpp
* \brief Header for GeographicLib::OSGB class * \brief Header for GeographicLib::OSGB class
* *
* Copyright (c) Charles Karney (2010, 2011) <charles@karney.com> and licen sed * Copyright (c) Charles Karney (2010, 2011) <charles@karney.com> and licen sed
* under the MIT/X11 License. For more information, see * under the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_OSGB_HPP) #if !defined(GEOGRAPHICLIB_OSGB_HPP)
#define GEOGRAPHICLIB_OSGB_HPP "$Id: a8dbde4065691daa15563ea55c23eab4b7d8e9 67 $" #define GEOGRAPHICLIB_OSGB_HPP "$Id: 8d8f45bf479e7191b7dae5f8dd2f43ede9e934 d2 $"
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/TransverseMercator.hpp> #include <GeographicLib/TransverseMercator.hpp>
#if defined(_MSC_VER) #if defined(_MSC_VER)
// Squelch warnings about dll vs string // Squelch warnings about dll vs string
#pragma warning (push) #pragma warning (push)
#pragma warning (disable: 4251) #pragma warning (disable: 4251)
skipping to change at line 195 skipping to change at line 195
/** /**
* @return \e f the inverse flattening of the Airy 1830 ellipsoid. * @return \e f the inverse flattening of the Airy 1830 ellipsoid.
* *
* For the Airy 1830 ellipsoid, \e a = 20923713 ft and \e b = 20853810 ft; * For the Airy 1830 ellipsoid, \e a = 20923713 ft and \e b = 20853810 ft;
* thus the flattening = (20923713 - 20853810)/20923713 = 7767/2324857 = * thus the flattening = (20923713 - 20853810)/20923713 = 7767/2324857 =
* 1/299.32496459... (The Airy 1830 value is returned because the OSGB * 1/299.32496459... (The Airy 1830 value is returned because the OSGB
* projection is based on this ellipsoid.) * projection is based on this ellipsoid.)
********************************************************************** / ********************************************************************** /
static Math::real Flattening() throw() static Math::real Flattening() throw()
{ return real(20923713 - 20853810) / real(20923713); } { return real(20923713 - 20853810) / real(20923713); }
/** /**
* <b>DEPRECATED</b> * <b>DEPRECATED</b>
* @return \e r the inverse flattening of the Airy 1830 ellipsoid. * @return \e r the inverse flattening of the Airy 1830 ellipsoid.
********************************************************************** / ********************************************************************** /
static Math::real InverseFlattening() throw() { return 1/Flattening(); } static Math::real InverseFlattening() throw() { return 1/Flattening(); }
/** /**
* @return \e k0 central scale for the OSGB projection (0.9996012717). * @return \e k0 central scale for the OSGB projection (0.9996012717).
********************************************************************** / ********************************************************************** /
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 SphericalHarmonic.hpp   SphericalHarmonic.hpp 
skipping to change at line 12 skipping to change at line 12
* \file SphericalHarmonic.hpp * \file SphericalHarmonic.hpp
* \brief Header for GeographicLib::SphericalHarmonic class * \brief Header for GeographicLib::SphericalHarmonic class
* *
* Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un der * Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed un der
* the MIT/X11 License. For more information, see * the MIT/X11 License. For more information, see
* http://geographiclib.sourceforge.net/ * http://geographiclib.sourceforge.net/
**********************************************************************/ **********************************************************************/
#if !defined(GEOGRAPHICLIB_SPHERICALHARMONIC_HPP) #if !defined(GEOGRAPHICLIB_SPHERICALHARMONIC_HPP)
#define GEOGRAPHICLIB_SPHERICALHARMONIC_HPP \ #define GEOGRAPHICLIB_SPHERICALHARMONIC_HPP \
"$Id: cd1abfd4b08774a17c141bb6fbb07b04d4658791 $" "$Id: 6fa804c46efd01670cfb7835dd022791b60d2942 $"
#include <vector> #include <vector>
#include <GeographicLib/Constants.hpp> #include <GeographicLib/Constants.hpp>
#include <GeographicLib/SphericalEngine.hpp> #include <GeographicLib/SphericalEngine.hpp>
#include <GeographicLib/CircularEngine.hpp> #include <GeographicLib/CircularEngine.hpp>
#include <GeographicLib/Geocentric.hpp> #include <GeographicLib/Geocentric.hpp>
namespace GeographicLib { namespace GeographicLib {
/** /**
skipping to change at line 212 skipping to change at line 212
* Compute the spherical harmonic sum. * Compute the spherical harmonic sum.
* *
* @param[in] x cartesian coordinate. * @param[in] x cartesian coordinate.
* @param[in] y cartesian coordinate. * @param[in] y cartesian coordinate.
* @param[in] z cartesian coordinate. * @param[in] z cartesian coordinate.
* @return \e V the spherical harmonic sum. * @return \e V the spherical harmonic sum.
* *
* This routine requires constant memory and thus never throws an * This routine requires constant memory and thus never throws an
* exception. * exception.
********************************************************************** / ********************************************************************** /
Math::real operator()(real x, real y, real z) const throw() { Math::real operator()(real x, real y, real z) const throw() {
real f[] = {1}; real f[] = {1};
real v = 0; real v = 0;
real dummy; real dummy;
switch (_norm) { switch (_norm) {
case FULL: case FULL:
v = SphericalEngine::Value<false, SphericalEngine::FULL, 1> v = SphericalEngine::Value<false, SphericalEngine::FULL, 1>
(_c, f, x, y, z, _a, dummy, dummy, dummy); (_c, f, x, y, z, _a, dummy, dummy, dummy);
break; break;
case SCHMIDT: case SCHMIDT:
v = SphericalEngine::Value<false, SphericalEngine::SCHMIDT, 1> v = SphericalEngine::Value<false, SphericalEngine::SCHMIDT, 1>
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 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/