18 , _f(f <= 1 ? f : 1/f)
20 , _e2m(
Math::sq(1 - _f))
23 , _maxrad(2 * _a / numeric_limits<real>::epsilon())
38 real M[dim2_])
const {
44 cphi = abs(lat) == 90 ? 0 : cos(phi),
45 n = _a/sqrt(1 - _e2 *
Math::sq(sphi)),
46 slam = lon == -180 ? 0 : sin(lam),
47 clam = abs(lon) == 90 ? 0 : cos(lam);
48 Z = (_e2m * n + h) * sphi;
53 Rotation(sphi, cphi, slam, clam, M);
58 real M[dim2_])
const {
73 slam = R ? (Y/2) / R : 0;
74 clam = R ? (X/2) / R : 1;
78 }
else if (_e4a == 0) {
83 sphi = (h == 0 ? 1 : Z) / H;
92 r = (p + q - _e4a) / 6;
93 if (_f < 0) swap(p, q);
94 if ( !(_e4a * q == 0 && r <= 0) ) {
101 disc = S * (2 * r3 + S);
108 T3 += T3 < 0 ? -sqrt(disc) : sqrt(disc);
112 u += T + (T ? r2 / T : 0);
115 real ang = atan2(sqrt(-disc), -(S + r3));
118 u += 2 * r * cos(ang / 3);
124 uv = u < 0 ? _e4a * q / (v - u) : u + v,
126 w = max(
real(0), _e2a * (uv - q) / (2 * v)),
129 k = uv / (sqrt(uv +
Math::sq(w)) + w),
130 k1 = _f >= 0 ? k : k - _e2,
131 k2 = _f >= 0 ? k + _e2 : k,
145 zz = sqrt((_f >= 0 ? _e4a - p : p) / _e2m),
146 xx = sqrt( _f < 0 ? _e4a - p : p ),
150 if (Z < 0) sphi = -sphi;
151 h = - _a * (_f >= 0 ? _e2m : 1) * H / _e2a;
157 Rotation(sphi, cphi, slam, clam, M);
170 M[0] = -slam; M[3] = clam; M[6] = 0;
172 M[1] = -clam * sphi; M[4] = -slam * sphi; M[7] = cphi;
174 M[2] = clam * cphi; M[5] = slam * cphi; M[8] = sphi;
static T AngNormalize(T x)
GeographicLib::Math::real real
static bool isfinite(T x)
Mathematical functions needed by GeographicLib.
static const Geocentric & WGS84()
static T atan2d(T y, T x)
Namespace for GeographicLib.
Header for GeographicLib::Geocentric class.
Exception handling for GeographicLib.