20 , _es((_f < 0 ? -1 : 1) * sqrt(fabs(_e2)))
22 , _c( (1 - _f) * exp(
Math::eatanhe(real(1), _es)) )
25 if (!(isfinite(_a) && _a > 0))
27 if (!(isfinite(_f) && _f < 1))
29 if (!(isfinite(_k0) && _k0 > 0))
63 real& gamma, real& k)
const {
65 lat *= northp ? 1 : -1;
68 secphi = hypot(real(1), tau),
70 rho = hypot(real(1), taup) + fabs(taup);
71 rho = taup >= 0 ? (lat !=
Math::qd ? 1/rho : 0) : rho;
72 rho *= 2 * _k0 * _a / _c;
74 (rho / _a) * secphi * sqrt(_e2m + _e2 /
Math::sq(secphi)) : _k0;
77 y *= (northp ? -rho : rho);
83 real& gamma, real& k)
const {
86 t = rho != 0 ? rho / (2 * _k0 * _a / _c) :
87 Math::sq(numeric_limits<real>::epsilon()),
88 taup = (1 / t - t) / 2,
90 secphi = hypot(real(1), tau);
91 k = rho != 0 ? (rho / _a) * secphi * sqrt(_e2m + _e2 /
Math::sq(secphi)) :
99 if (!(isfinite(k) && k > 0))
103 +
"d, " + to_string(
Math::qd) +
"d]");
104 real x, y, gamma, kold;
106 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 constexpr int qd
degrees per quarter turn
static T tauf(T taup, T es)
static T AngNormalize(T x)
static T taupf(T tau, T es)
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.