33 real tphi1 = phi1.
tan(), tmu1 = mu1.
tan();
35 isfinite(tphi1) ? d *
Math::sq(base::sc(tphi1)/base::sc(tmu1)) : 1/d;
41 real dEdbet = DE(bet1, bet2), dbetdphi =
DParametric(phi1, phi2);
49 real tx = phi1.
tan(), ty = phi2.
tan(), r;
55 r = (atan(base::_fm1 * ty) - atan(base::_fm1 * tx)) /
56 (atan(ty) - atan(tx));
60 r = base::_fm1 * (1 + tx) / (1 + base::_e2m1 * tx);
63 r = base::_fm1 * (1 + tx) / (base::_e2m1 + tx);
67 r = atan2(base::_fm1 * (ty - tx), 1 + base::_e2m1 * tx * ty)
68 / atan2( ty - tx , 1 + tx * ty);
71 r = atan2(base::_fm1 * (ty - tx), base::_e2m1 + tx * ty)
72 / atan2( ty - tx , 1 + tx * ty);
90 Xn.y() = fabs(Xn.y()); Yn.y() = fabs(Yn.y());
91 real k2 = -base::_e12;
92 bool flip = base::_f < 0;
99 real x = Xn.radians(), y = Yn.radians(), d = y - x,
100 sx = Xn.y(), sy = Yn.y(), cx = Xn.x(), cy = Yn.x();
112 real Dt = Dsin(x, y) * (sx + sy) /
113 ((cx + cy) * (sx * sqrt(1 - k2 * sy*sy) + sy * sqrt(1 - k2 * sx*sx))),
114 t = d * Dt, Dsz = 2 * Dt / (1 + t*t),
115 sz = d * Dsz, cz = (1 - t) * (1 + t) / (1 + t*t),
116 sz2 = sz*sz, cz2 = cz*cz, dz2 = 1 - k2 * sz2,
120 return (Ezbsz - k2 * sx * sy) * Dsz / (flip ? 1 - base::_f : 1);
125 real sc1 = base::sc(x);
126 if (x == y)
return 1 / (sc1 * (1 + x*x));
127 real sc2 = base::sc(y), sn1 = base::sn(x), sn2 = base::sn(y);
129 (sn1/sc2 + sn2/sc1) / ((sn1 + sn2) * sc1 * sc2) :
130 (sn2 - sn1) / (y - x);
133 real d = y - x, xy = x*y;
134 return x == y ? 1 / (1 + xy) :
135 (isinf(xy) && xy > 0 ? 0 :
136 (2 * xy > -1 ? atan( d / (1 + xy) ) : atan(y) - atan(x)) / d);
139 real d = y - x, xy = x*y, hx = base::sc(x), hy = base::sc(y);
142 return x == y ? 1 / hx :
144 (xy > 0 ? asinh(d * (x*y < 1 ? (x + y) / (x*hy + y*hx) :
145 (1/x + 1/y) / (hy/y + hx/x))) :
146 asinh(y) - asinh(x)) / d);
152 return copysign(1/
real(2), x);
154 return copysign(1/
real(2), y);
155 real sx = base::sn(x), sy = base::sn(y), d = sx*x + sy*y;
159 return (h(y) - h(x)) / (y - x);
160 real scx = base::sc(x), scy = base::sc(y);
161 return ((x + y) / (2 * d)) *
172 return base::_f < 0 ?
173 Datan(base::_e * base::sn(x), base::_e * base::sn(y)) * Dsn(x, y) :
174 Dasinh(base::_e1 * base::sn(base::_fm1 * x),
175 base::_e1 * base::sn(base::_fm1 * y)) *
176 Dsn(base::_fm1 * x, base::_fm1 * y);
184 real tphi1 = phi1.
tan(), tphi2 = phi2.
tan();
185 return isnan(tphi1) || isnan(tphi2) ? numeric_limits<real>::quiet_NaN() :
186 (isinf(tphi1) || isinf(tphi2) ? numeric_limits<real>::infinity() :
187 (Dasinh(tphi1, tphi2) - base::_e2 * Datanhee(tphi1, tphi2)) /
188 Datan(tphi1, tphi2));
195 int k = base::ind(auxout, auxin);
196 if (k < 0)
return numeric_limits<real>::quiet_NaN();
197 if (auxin == auxout)
return 1;
198 if ( isnan(base::_c[
base::Lmax * (k + 1) - 1]) )
199 base::fillcoeff(auxin, auxout, k);
202 zeta1n.y(), zeta1n.x(), zeta2n.
y(), zeta2n.
x(),
207 real szeta1, real czeta1,
208 real szeta2, real czeta2,
209 const real c[],
int K) {
224 real D2 = Delta * Delta,
225 czetap = czeta2 * czeta1 - szeta2 * szeta1,
226 szetap = szeta2 * czeta1 + czeta2 * szeta1,
227 czetam = czeta2 * czeta1 + szeta2 * szeta1,
229 szetamd = (Delta == 1 ? szeta2 * czeta1 - czeta2 * szeta1 :
230 (Delta != 0 ? sin(Delta) / Delta : 1)),
231 Xa = 2 * czetap * czetam,
232 Xb = -2 * szetap * szetamd,
233 u0a = 0, u0b = 0, u1a = 0, u1b = 0;
234 for (--k; k >= 0; --k) {
236 real ta = Xa * u0a + D2 * Xb * u0b - u1a + c[k],
237 tb = Xb * u0a + Xa * u0b - u1b;
253 real F0a = (sinp ? szetap : czetap) * czetam,
254 F0b = (sinp ? czetap : -szetap) * szetamd,
258 return 2 * (F0a * u0b + F0b * u0a - Fm1a * u1b);
Header for the GeographicLib::DAuxLatitude class.
Header for GeographicLib::EllipticFunction class.
GeographicLib::Math::real real
An accurate representation of angles.
Math::real radians() const
AuxAngle normalized() const
Math::real RectifyingRadius(bool exact=false) const
AuxAngle Parametric(const AuxAngle &phi, real *diff=nullptr) const
AuxAngle Rectifying(const AuxAngle &phi, real *diff=nullptr) const
Math::real DParametric(const AuxAngle &phi1, const AuxAngle &phi2) const
Math::real DConvert(int auxin, int auxout, const AuxAngle &zeta1, const AuxAngle &zeta2) const
Math::real DIsometric(const AuxAngle &phi1, const AuxAngle &phi2) const
static Math::real DClenshaw(bool sinp, real Delta, real szeta1, real czeta1, real szeta2, real czeta2, const real c[], int K)
Math::real DRectifying(const AuxAngle &phi1, const AuxAngle &phi2) const
static real RD(real x, real y, real z)
static real RF(real x, real y, real z)
Namespace for GeographicLib.
void swap(GeographicLib::NearestNeighbor< dist_t, pos_t, distfun_t > &a, GeographicLib::NearestNeighbor< dist_t, pos_t, distfun_t > &b)