Constants.hpp | Constants.hpp | |||
---|---|---|---|---|
/** | /** | |||
* \file Constants.hpp | * \file Constants.hpp | |||
* \brief Header for GeographicLib::Constants class | * \brief Header for GeographicLib::Constants class | |||
* | * | |||
* Copyright (c) Charles Karney (2008, 2009, 2010) <charles@karney.com> | * Copyright (c) Charles Karney (2008, 2009, 2010) <charles@karney.com> | |||
* and licensed under the LGPL. For more information, see | * and licensed under the LGPL. For more information, see | |||
* http://geographiclib.sourceforge.net/ | * http://geographiclib.sourceforge.net/ | |||
**********************************************************************/ | **********************************************************************/ | |||
#if !defined(GEOGRAPHICLIB_CONSTANTS_HPP) | #if !defined(GEOGRAPHICLIB_CONSTANTS_HPP) | |||
#define GEOGRAPHICLIB_CONSTANTS_HPP "$Id: Constants.hpp 6785 2010-01-05 22: 15:42Z karney $" | #define GEOGRAPHICLIB_CONSTANTS_HPP "$Id: Constants.hpp 6817 2010-02-08 14: 42:35Z karney $" | |||
/** | /** | |||
* A simple compile-time assert. This is designed to be compatible with th e | * A simple compile-time assert. This is designed to be compatible with th e | |||
* C++0X static_assert. | * C++0X static_assert. | |||
**********************************************************************/ | **********************************************************************/ | |||
#if !defined(STATIC_ASSERT) | #if !defined(STATIC_ASSERT) | |||
#define STATIC_ASSERT(cond,reason) { enum{ STATIC_ASSERT_ENUM=1/int(cond) } ; } | #define STATIC_ASSERT(cond,reason) { enum{ STATIC_ASSERT_ENUM=1/int(cond) } ; } | |||
#endif | #endif | |||
#if defined(__GNUC__) | #if defined(__GNUC__) | |||
skipping to change at line 101 | skipping to change at line 101 | |||
/** | /** | |||
* Return sqrt(\e x<sup>2</sup> + \e y<sup>2</sup>) avoiding underflow and | * Return sqrt(\e x<sup>2</sup> + \e y<sup>2</sup>) avoiding underflow and | |||
* overflow. | * overflow. | |||
********************************************************************** / | ********************************************************************** / | |||
static inline real hypot(real x, real y) throw() { | static inline real hypot(real x, real y) throw() { | |||
x = std::abs(x); | x = std::abs(x); | |||
y = std::abs(y); | y = std::abs(y); | |||
real | real | |||
a = std::max(x, y), | a = std::max(x, y), | |||
b = std::min(x, y) / a; | b = std::min(x, y) / a; | |||
return a * sqrt(1 + b * b); | return a * std::sqrt(1 + b * b); | |||
} | } | |||
#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); } | |||
static inline float hypot(float x, float y) throw() | static inline float hypot(float x, float y) throw() | |||
{ return _hypotf(x, y); } | { return _hypotf(x, y); } | |||
#else | #else | |||
// Use overloading to define generic versions | // Use overloading to define generic versions | |||
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); } | |||
skipping to change at line 352 | skipping to change at line 352 | |||
}; | }; | |||
/** | /** | |||
* \brief %Exception handling for %GeographicLib | * \brief %Exception handling for %GeographicLib | |||
* | * | |||
* A class to handle exceptions. It's derived off std::runtime_error so it | * A class to handle exceptions. It's derived off std::runtime_error so it | |||
* can be caught by the usual catch clauses. | * can be caught by the usual catch clauses. | |||
**********************************************************************/ | **********************************************************************/ | |||
class GeographicErr : public std::runtime_error { | class GeographicErr : public std::runtime_error { | |||
public: | public: | |||
/** | ||||
* Constructor takes a string message, \e msg, which is accessible in t | ||||
he | ||||
* catch 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 | #endif | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 9 lines changed or added | |||
LambertConformalConic.hpp | LambertConformalConic.hpp | |||
---|---|---|---|---|
/** | /** | |||
* \file LambertConformalConic.hpp | * \file LambertConformalConic.hpp | |||
* \brief Header for GeographicLib::LambertConformalConic class | * \brief Header for GeographicLib::LambertConformalConic class | |||
* | * | |||
* Copyright (c) Charles Karney (2009, 2010) <charles@karney.com> | * Copyright (c) Charles Karney (2009, 2010) <charles@karney.com> | |||
* and licensed under the LGPL. For more information, see | * and licensed under the LGPL. 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 "$Id: LambertConformalConic .hpp 6720 2009-10-17 23:13:57Z ckarney $" | #define GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP "$Id: LambertConformalConic .hpp 6816 2010-02-05 21:03:10Z karney $" | |||
#include "GeographicLib/Constants.hpp" | #include "GeographicLib/Constants.hpp" | |||
#include <algorithm> | #include <algorithm> | |||
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 87 | skipping to change at line 87 | |||
private: | private: | |||
typedef Math::real real; | typedef Math::real real; | |||
const real _a, _r, _f, _e2, _e, _e2m; | const real _a, _r, _f, _e2, _e, _e2m; | |||
real _sign, _n, _nc, _lt0, _t0n, _t0nm1, _scale, _lat0, _k0; | real _sign, _n, _nc, _lt0, _t0n, _t0nm1, _scale, _lat0, _k0; | |||
static const real eps, eps2, epsx, tol, ahypover; | static const real eps, eps2, epsx, tol, ahypover; | |||
static const int numit = 5; | static const int numit = 5; | |||
static inline real sq(real x) throw() { return x * x; } | static inline real sq(real x) throw() { return x * 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 * atan(_e * x); | return _f >= 0 ? _e * Math::atanh(_e * x) : - _e * std::atan(_e * x); | |||
} | } | |||
inline real mf(real sphi, real cphi) const throw() { | inline real mf(real sphi, real cphi) const throw() { | |||
return cphi/std::sqrt(1 - _e2 * sq(sphi)); // Snyder's m, p 108, eq 1 4-15 | return cphi/std::sqrt(1 - _e2 * sq(sphi)); // Snyder's m, p 108, eq 1 4-15 | |||
} | } | |||
inline real tf(real sphi, real cphi) const throw() { | inline real tf(real sphi, real cphi) const throw() { | |||
// Snyder's t, p 108, eq 15-9a | // Snyder's t, p 108, eq 15-9a | |||
// First factor is sqrt((1 - sphi) / (1 + sphi)) | // First factor is sqrt((1 - sphi) / (1 + sphi)) | |||
// Second factor is ((1 + e * sphi)/(1 - e * sphi)) ^ (e/2) | // Second factor is ((1 + e * sphi)/(1 - e * sphi)) ^ (e/2) | |||
return (sphi >= 0 ? cphi / (1 + sphi) : (1 - sphi) / cphi) * | return (sphi >= 0 ? cphi / (1 + sphi) : (1 - sphi) / cphi) * | |||
exp(eatanhe(sphi)); | std::exp(eatanhe(sphi)); | |||
} | } | |||
inline real logtf(real sphi, real cphi) const throw() { | inline real logtf(real sphi, real cphi) const throw() { | |||
// Return log(t). This retains relative accuracy near the equator wh ere | // Return log(t). This retains relative accuracy near the equator wh ere | |||
// t -> 1. This is the negative of the standard Mercator northing. Note | // t -> 1. This is the negative of the standard Mercator northing. Note | |||
// that log( sqrt((1 - sin(phi)) / (1 + sin(phi))) ) = -asinh(tan(phi )) | // that log( sqrt((1 - sin(phi)) / (1 + sin(phi))) ) = -asinh(tan(phi )) | |||
return -Math::asinh(sphi/std::max(epsx, cphi)) + eatanhe(sphi); | return -Math::asinh(sphi/std::max(epsx, cphi)) + eatanhe(sphi); | |||
} | } | |||
inline real logmtf(real sphi) const throw() { | inline real logmtf(real sphi) const throw() { | |||
// Return log(m/t). This allows the cancellation of cphi in m and t. | // Return log(m/t). This allows the cancellation of cphi in m and t. | |||
return log((1 + sphi)/std::sqrt(1 - _e2 * sq(sphi))) - eatanhe(sphi); | return std::log((1 + sphi)/std::sqrt(1 - _e2 * sq(sphi))) - | |||
eatanhe(sphi); | ||||
} | } | |||
void Init(real sphi1, real cphi1, real sphi2, real cphi2, real k1) thro w(); | void Init(real sphi1, real cphi1, real sphi2, real cphi2, real k1) thro w(); | |||
public: | public: | |||
/** | /** | |||
* Constructor for a ellipsoid radius \e a (meters), reciprocal flatten ing | * Constructor for a ellipsoid radius \e a (meters), reciprocal flatten ing | |||
* \e r, standard parallel (the circle of tangency) \e stdlat (degrees) , | * \e r, standard parallel (the circle of tangency) \e stdlat (degrees) , | |||
* and scale on the standard parallel \e k0. Setting \e r = 0 implies \e r | * and scale on the standard parallel \e k0. Setting \e r = 0 implies \e r | |||
* = inf or flattening = 0 (i.e., a sphere). An exception is thrown if \e a | * = inf or flattening = 0 (i.e., a sphere). An exception is thrown if \e a | |||
* or \e k0 is not positive or if \e stdlat is not in the range [-90, 9 0]. | * or \e k0 is not positive or if \e stdlat is not in the range [-90, 9 0]. | |||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 5 lines changed or added | |||
PolarStereographic.hpp | PolarStereographic.hpp | |||
---|---|---|---|---|
/** | /** | |||
* \file PolarStereographic.hpp | * \file PolarStereographic.hpp | |||
* \brief Header for GeographicLib::PolarStereographic class | * \brief Header for GeographicLib::PolarStereographic class | |||
* | * | |||
* Copyright (c) Charles Karney (2008, 2009, 2010) <charles@karney.com> | * Copyright (c) Charles Karney (2008, 2009, 2010) <charles@karney.com> | |||
* and licensed under the LGPL. For more information, see | * and licensed under the LGPL. For more information, see | |||
* http://geographiclib.sourceforge.net/ | * http://geographiclib.sourceforge.net/ | |||
**********************************************************************/ | **********************************************************************/ | |||
#if !defined(GEOGRAPHICLIB_POLARSTEREOGRAPHIC_HPP) | #if !defined(GEOGRAPHICLIB_POLARSTEREOGRAPHIC_HPP) | |||
#define GEOGRAPHICLIB_POLARSTEREOGRAPHIC_HPP "$Id: PolarStereographic.hpp 6 785 2010-01-05 22:15:42Z karney $" | #define GEOGRAPHICLIB_POLARSTEREOGRAPHIC_HPP "$Id: PolarStereographic.hpp 6 807 2010-02-01 11:26:34Z karney $" | |||
#include "GeographicLib/Constants.hpp" | #include "GeographicLib/Constants.hpp" | |||
namespace GeographicLib { | namespace GeographicLib { | |||
/** | /** | |||
* \brief Polar Stereographic Projection | * \brief Polar Stereographic Projection | |||
* | * | |||
* Implementation taken from the report, | * Implementation taken from the report, | |||
* - J. P. Snyder, | * - J. P. Snyder, | |||
skipping to change at line 40 | skipping to change at line 40 | |||
private: | private: | |||
typedef Math::real real; | typedef Math::real real; | |||
const real _a, _r, _f, _e2, _e, _e2m, _c; | const real _a, _r, _f, _e2, _e, _e2m, _c; | |||
real _k0; | real _k0; | |||
static const real tol; | static const real tol; | |||
static const int numit = 5; | static const int numit = 5; | |||
static inline real sq(real x) throw() { return x * x; } | static inline real sq(real x) throw() { return x * x; } | |||
// 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 * atan(_e * x); | return _f >= 0 ? _e * Math::atanh(_e * x) : - _e * std::atan(_e * x); | |||
} | } | |||
public: | public: | |||
/** | /** | |||
* Constructor for a ellipsoid radius \e a (meters), reciprocal flatten ing | * Constructor for a ellipsoid radius \e a (meters), reciprocal flatten ing | |||
* \e r, and central scale factor \e k0. Setting \e r <= 0 implies \e r = | * \e r, and central scale factor \e k0. Setting \e r <= 0 implies \e r = | |||
* inf or flattening = 0 (i.e., a sphere). An exception is thrown if \ e a | * inf or flattening = 0 (i.e., a sphere). An exception is thrown if \ e a | |||
* or \e k0 is not positive. | * or \e k0 is not positive. | |||
********************************************************************** / | ********************************************************************** / | |||
PolarStereographic(real a, real r, real k0); | PolarStereographic(real a, real r, real k0); | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
TransverseMercator.hpp | TransverseMercator.hpp | |||
---|---|---|---|---|
/** | /** | |||
* \file TransverseMercator.hpp | * \file TransverseMercator.hpp | |||
* \brief Header for GeographicLib::TransverseMercator class | * \brief Header for GeographicLib::TransverseMercator class | |||
* | * | |||
* Copyright (c) Charles Karney (2008, 2009, 2010) <charles@karney.com> | * Copyright (c) Charles Karney (2008, 2009, 2010) <charles@karney.com> | |||
* and licensed under the LGPL. For more information, see | * and licensed under the LGPL. For more information, see | |||
* http://geographiclib.sourceforge.net/ | * http://geographiclib.sourceforge.net/ | |||
**********************************************************************/ | **********************************************************************/ | |||
#if !defined(GEOGRAPHICLIB_TRANSVERSEMERCATOR_HPP) | #if !defined(GEOGRAPHICLIB_TRANSVERSEMERCATOR_HPP) | |||
#define GEOGRAPHICLIB_TRANSVERSEMERCATOR_HPP "$Id: TransverseMercator.hpp 6 785 2010-01-05 22:15:42Z karney $" | #define GEOGRAPHICLIB_TRANSVERSEMERCATOR_HPP "$Id: TransverseMercator.hpp 6 807 2010-02-01 11:26:34Z karney $" | |||
#include "GeographicLib/Constants.hpp" | #include "GeographicLib/Constants.hpp" | |||
#if !defined(TM_TX_MAXPOW) | #if !defined(TM_TX_MAXPOW) | |||
/** | /** | |||
* The order of the series approximation used in | * The order of the series approximation used in | |||
* GeographicLib::TransverseMercator. TM_TX_MAXPOW can be set to any integ er | * GeographicLib::TransverseMercator. TM_TX_MAXPOW can be set to any integ er | |||
* in [4, 8]. | * in [4, 8]. | |||
**********************************************************************/ | **********************************************************************/ | |||
#define TM_TX_MAXPOW \ | #define TM_TX_MAXPOW \ | |||
(sizeof(real) == sizeof(double) ? 6 : sizeof(real) == sizeof(float) ? 5 : 7 ) | (sizeof(real) == sizeof(double) ? 6 : sizeof(real) == sizeof(float) ? 4 : 8 ) | |||
#endif | #endif | |||
namespace GeographicLib { | namespace GeographicLib { | |||
/** | /** | |||
* \brief Transverse Mercator Projection | * \brief Transverse Mercator Projection | |||
* | * | |||
* This uses Krüger's method which evaluates the projection and its | * This uses Krüger's method which evaluates the projection and its | |||
* inverse in terms of a series. See | * inverse in terms of a series. See | |||
* - L. Krüger, | * - L. Krüger, | |||
skipping to change at line 97 | skipping to change at line 97 | |||
* | * | |||
* See TransverseMercator.cpp for more information on the implementation. | * See TransverseMercator.cpp for more information on the implementation. | |||
* | * | |||
* See \ref transversemercator for a discussion of this projection. | * See \ref transversemercator for a discussion of this projection. | |||
**********************************************************************/ | **********************************************************************/ | |||
class TransverseMercator { | class TransverseMercator { | |||
private: | private: | |||
typedef Math::real real; | typedef Math::real real; | |||
static const int maxpow = TM_TX_MAXPOW; | static const int maxpow = TM_TX_MAXPOW; | |||
static const real tol; | static const real tol, overflow; | |||
static const int numit = 5; | static const int numit = 5; | |||
const real _a, _r, _f, _k0, _e2, _e, _e2m, _c, _n; | const real _a, _r, _f, _k0, _e2, _e, _e2m, _c, _n; | |||
real _a1, _b1, _h[maxpow], _hp[maxpow]; | // _alp[0] and _bet[0] unused | |||
real _a1, _b1, _alp[maxpow + 1], _bet[maxpow + 1]; | ||||
static inline real sq(real x) throw() { return x * x; } | static inline real sq(real x) throw() { return x * x; } | |||
// tan(x) for x in [-pi/2, pi/2] ensuring that the sign is right | ||||
static inline real tanx(real x) throw() { | ||||
real t = std::tan(x); | ||||
return x >= 0 ? (t >= 0 ? t : overflow) : (t < 0 ? t : -overflow); | ||||
} | ||||
// 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 * atan(_e * x); | return _f >= 0 ? _e * Math::atanh(_e * x) : - _e * std::atan(_e * x); | |||
} | } | |||
public: | public: | |||
/** | /** | |||
* Constructor for a ellipsoid radius \e a (meters), reciprocal flatten ing | * Constructor for a ellipsoid radius \e a (meters), reciprocal flatten ing | |||
* \e r, and central scale factor \e k0. Setting \e r = 0 implies \e r = | * \e r, and central scale factor \e k0. Setting \e r = 0 implies \e r = | |||
* inf or flattening = 0 (i.e., a sphere). Negative \e r indicates a | * inf or flattening = 0 (i.e., a sphere). Negative \e r indicates a | |||
* prolate spheroid. An exception is thrown if \e a or \e k0 is | * prolate spheroid. An exception is thrown if \e a or \e k0 is | |||
* not positive. | * not positive. | |||
********************************************************************** / | ********************************************************************** / | |||
End of changes. 6 change blocks. | ||||
5 lines changed or deleted | 11 lines changed or added | |||
TransverseMercatorExact.hpp | TransverseMercatorExact.hpp | |||
---|---|---|---|---|
/** | /** | |||
* \file TransverseMercatorExact.hpp | * \file TransverseMercatorExact.hpp | |||
* \brief Header for GeographicLib::TransverseMercatorExact class | * \brief Header for GeographicLib::TransverseMercatorExact class | |||
* | * | |||
* Copyright (c) Charles Karney (2008, 2009, 2010) <charles@karney.com> | * Copyright (c) Charles Karney (2008, 2009, 2010) <charles@karney.com> | |||
* and licensed under the LGPL. For more information, see | * and licensed under the LGPL. For more information, see | |||
* http://geographiclib.sourceforge.net/ | * http://geographiclib.sourceforge.net/ | |||
**********************************************************************/ | **********************************************************************/ | |||
#if !defined(GEOGRAPHICLIB_TRANSVERSEMERCATOREXACT_HPP) | #if !defined(GEOGRAPHICLIB_TRANSVERSEMERCATOREXACT_HPP) | |||
#define GEOGRAPHICLIB_TRANSVERSEMERCATOREXACT_HPP "$Id: TransverseMercatorE xact.hpp 6785 2010-01-05 22:15:42Z karney $" | #define GEOGRAPHICLIB_TRANSVERSEMERCATOREXACT_HPP "$Id: TransverseMercatorE xact.hpp 6807 2010-02-01 11:26:34Z karney $" | |||
#include "GeographicLib/Constants.hpp" | #include "GeographicLib/Constants.hpp" | |||
#include "GeographicLib/EllipticFunction.hpp" | #include "GeographicLib/EllipticFunction.hpp" | |||
namespace GeographicLib { | namespace GeographicLib { | |||
/** | /** | |||
* \brief An exact implementation of the Transverse Mercator Projection | * \brief An exact implementation of the Transverse Mercator Projection | |||
* | * | |||
* Implementation of the Transverse Mercator Projection given in | * Implementation of the Transverse Mercator Projection given in | |||
skipping to change at line 65 | skipping to change at line 65 | |||
* | * | |||
* See TransverseMercatorExact.cpp for more information on the | * See TransverseMercatorExact.cpp for more information on the | |||
* implementation. | * implementation. | |||
* | * | |||
* See \ref transversemercator for a discussion of this projection. | * See \ref transversemercator for a discussion of this projection. | |||
**********************************************************************/ | **********************************************************************/ | |||
class TransverseMercatorExact { | class TransverseMercatorExact { | |||
private: | private: | |||
typedef Math::real real; | typedef Math::real real; | |||
static const real tol, tol1, tol2, taytol, ahypover; | static const real tol, tol1, tol2, taytol, overflow; | |||
static const int numit = 10; | static const int numit = 10; | |||
const real _a, _r, _f, _k0, _mu, _mv, _e, _ep2; | const real _a, _r, _f, _k0, _mu, _mv, _e, _ep2; | |||
const bool _extendp; | const bool _extendp; | |||
const EllipticFunction _Eu, _Ev; | const EllipticFunction _Eu, _Ev; | |||
static inline real sq(real x) throw() { return x * x; } | static inline real sq(real x) throw() { return x * x; } | |||
real psi(real phi) const throw(); | // tan(x) for x in [-pi/2, pi/2] ensuring that the sign is right | |||
real psiinv(real psi) const throw(); | static inline real tanx(real x) throw() { | |||
real t = std::tan(x); | ||||
return x >= 0 ? (t >= 0 ? t : overflow) : (t < 0 ? t : -overflow); | ||||
} | ||||
real taup(real tau) const throw(); | ||||
real taupinv(real taup) const throw(); | ||||
void zeta(real u, real snu, real cnu, real dnu, | void zeta(real u, real snu, real cnu, real dnu, | |||
real v, real snv, real cnv, real dnv, | real v, real snv, real cnv, real dnv, | |||
real& psi, real& lam) const throw(); | real& taup, real& lam) const throw(); | |||
void dwdzeta(real u, real snu, real cnu, real dnu, | void dwdzeta(real u, real snu, real cnu, real dnu, | |||
real v, real snv, real cnv, real dnv, | real v, real snv, real cnv, real dnv, | |||
real& du, real& dv) const throw(); | real& du, real& dv) const throw(); | |||
bool zetainv0(real psi, real lam, real& u, real& v) const throw(); | bool zetainv0(real psi, real lam, real& u, real& v) const throw(); | |||
void zetainv(real psi, real lam, real& u, real& v) const throw(); | void zetainv(real taup, real lam, real& u, real& v) const throw(); | |||
void sigma(real u, real snu, real cnu, real dnu, | void sigma(real u, real snu, real cnu, real dnu, | |||
real v, real snv, real cnv, real dnv, | real v, real snv, real cnv, real dnv, | |||
real& xi, real& eta) const throw(); | real& xi, real& eta) const throw(); | |||
void dwdsigma(real u, real snu, real cnu, real dnu, | void dwdsigma(real u, real snu, real cnu, real dnu, | |||
real v, real snv, real cnv, real dnv, | real v, real snv, real cnv, real dnv, | |||
real& du, real& dv) const throw(); | real& du, real& dv) const throw(); | |||
bool sigmainv0(real xi, real eta, real& u, real& v) const throw(); | bool sigmainv0(real xi, real eta, real& u, real& v) const throw(); | |||
void sigmainv(real xi, real eta, real& u, real& v) const throw(); | void sigmainv(real xi, real eta, real& u, real& v) const throw(); | |||
void Scale(real phi, real lam, | void Scale(real tau, real lam, | |||
real snu, real cnu, real dnu, | real snu, real cnu, real dnu, | |||
real snv, real cnv, real dnv, | real snv, real cnv, real dnv, | |||
real& gamma, real& k) const throw(); | real& gamma, real& k) const throw(); | |||
public: | public: | |||
/** | /** | |||
* Constructor for a ellipsoid radius \e a (meters), reciprocal flatten ing | * Constructor for a ellipsoid radius \e a (meters), reciprocal flatten ing | |||
* \e r, and central scale factor \e k0. The transverse Mercator | * \e r, and central scale factor \e k0. The transverse Mercator | |||
* projection has a branch point singularity at \e lat = 0 and \e lon - \e | * projection has a branch point singularity at \e lat = 0 and \e lon - \e | |||
End of changes. 6 change blocks. | ||||
7 lines changed or deleted | 13 lines changed or added | |||
UTMUPS.hpp | UTMUPS.hpp | |||
---|---|---|---|---|
/** | /** | |||
* \file UTMUPS.hpp | * \file UTMUPS.hpp | |||
* \brief Header for GeographicLib::UTMUPS class | * \brief Header for GeographicLib::UTMUPS class | |||
* | * | |||
* Copyright (c) Charles Karney (2008, 2009, 2010) <charles@karney.com> | * Copyright (c) Charles Karney (2008, 2009, 2010) <charles@karney.com> | |||
* and licensed under the LGPL. For more information, see | * and licensed under the LGPL. For more information, see | |||
* http://geographiclib.sourceforge.net/ | * http://geographiclib.sourceforge.net/ | |||
**********************************************************************/ | **********************************************************************/ | |||
#if !defined(GEOGRAPHICLIB_UTMUPS_HPP) | #if !defined(GEOGRAPHICLIB_UTMUPS_HPP) | |||
#define GEOGRAPHICLIB_UTMUPS_HPP "$Id: UTMUPS.hpp 6785 2010-01-05 22:15:42Z karney $" | #define GEOGRAPHICLIB_UTMUPS_HPP "$Id: UTMUPS.hpp 6805 2010-01-28 21:18:14Z karney $" | |||
#include "GeographicLib/Constants.hpp" | #include "GeographicLib/Constants.hpp" | |||
#include <sstream> | #include <sstream> | |||
namespace GeographicLib { | namespace GeographicLib { | |||
/** | /** | |||
* \brief Convert between Geographic coordinates and UTM/UPS | * \brief Convert between Geographic coordinates and UTM/UPS | |||
* | * | |||
* UTM and UPS are defined | * UTM and UPS are defined | |||
* - <a href="http://earth-info.nga.mil/GandG/publications/tm8358.2/TM835 | * - J. W. Hager, J. F. Behensky, and B. W. Drew, | |||
8_2.pdf"> | * <a href="http://earth-info.nga.mil/GandG/publications/tm8358.2/TM835 | |||
8_2.pdf"> | ||||
* The Universal Grids: Universal Transverse Mercator (UTM) and Univers al | * The Universal Grids: Universal Transverse Mercator (UTM) and Univers al | |||
* Polar Stereographic (UPS)</a>, Defense Mapping Agency, Technical Man ual | * Polar Stereographic (UPS)</a>, Defense Mapping Agency, Technical Man ual | |||
* TM8358.2 (1989). | * TM8358.2 (1989). | |||
* . | * . | |||
* Section 2-3 defines UTM and section 3-2.4 defines UPS. This document also | * Section 2-3 defines UTM and section 3-2.4 defines UPS. This document also | |||
* includes approximate algorithms for the computation of the underlying | * includes approximate algorithms for the computation of the underlying | |||
* transverse Mercator and polar stereographic projections. Here we | * transverse Mercator and polar stereographic projections. Here we | |||
* substitute much more accurate algorithms given by | * substitute much more accurate algorithms given by | |||
* GeographicLib:TransverseMercator and GeographicLib:PolarStereographic. | * GeographicLib:TransverseMercator and GeographicLib:PolarStereographic. | |||
* | * | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 4 lines changed or added | |||