14# pragma warning (disable: 5055)
25 , _es((_f < 0 ? -1 : 1) * sqrt(fabs(_e2)))
27 , _c( (1 - _f) * exp(
Math::eatanhe(real(1), _es)) )
30 if (!(isfinite(_a) && _a > 0))
32 if (!(isfinite(_f) && _f < 1))
34 if (!(isfinite(_k0) && _k0 > 0))
68 real& gamma, real& k)
const {
70 lat *= northp ? 1 : -1;
73 secphi = hypot(real(1), tau),
75 rho = hypot(real(1), taup) + fabs(taup);
76 rho = taup >= 0 ? (lat !=
Math::qd ? 1/rho : 0) : rho;
77 rho *= 2 * _k0 * _a / _c;
79 (rho / _a) * secphi * sqrt(_e2m + _e2 /
Math::sq(secphi)) : _k0;
82 y *= (northp ? -rho : rho);
88 real& gamma, real& k)
const {
91 t = rho != 0 ? rho / (2 * _k0 * _a / _c) :
92 Math::sq(numeric_limits<real>::epsilon()),
93 taup = (1 / t - t) / 2,
95 secphi = hypot(real(1), tau);
96 k = rho != 0 ? (rho / _a) * secphi * sqrt(_e2m + _e2 /
Math::sq(secphi)) :
104 if (!(isfinite(k) && k > 0))
108 +
"d, " + to_string(
Math::qd) +
"d]");
109 real x, y, gamma, kold;
111 Forward(
true, lat, 0, x, y, gamma, kold);
Header for GeographicLib::PolarStereographic class.
Exception handling for GeographicLib.
Mathematical functions needed by GeographicLib.
static void sincosd(T x, T &sinx, T &cosx)
static T atan2d(T y, T x)
static T tauf(T taup, T es)
static T AngNormalize(T x)
static T taupf(T tau, T es)
@ qd
degrees per quarter turn
Polar stereographic projection.
void Reverse(bool northp, real x, real y, real &lat, real &lon, real &gamma, real &k) const
PolarStereographic(real a, real f, real k0)
void SetScale(real lat, real k=real(1))
static const PolarStereographic & UPS()
void Forward(bool northp, real lat, real lon, real &x, real &y, real &gamma, real &k) const
Namespace for GeographicLib.