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);
134 real d = y - x, xy = x*y;
135 return x == y ? 1 / (1 + xy) :
136 (isinf(xy) && xy > 0 ? 0 :
137 (2 * xy > -1 ? atan( d / (1 + xy) ) : atan(y) - atan(x)) / d);
141 real d = y - x, xy = x*y, hx = base::sc(x), hy = base::sc(y);
144 return x == y ? 1 / hx :
146 (xy > 0 ? asinh(d * (x*y < 1 ? (x + y) / (x*hy + y*hx) :
147 (1/x + 1/y) / (hy/y + hx/x))) :
148 asinh(y) - asinh(x)) / d);
151 using std::isnan;
using std::isinf;
155 return copysign(1/
real(2), x);
157 return copysign(1/
real(2), y);
158 real sx = base::sn(x), sy = base::sn(y), d = sx*x + sy*y;
162 return (h(y) - h(x)) / (y - x);
163 real scx = base::sc(x), scy = base::sc(y);
164 return ((x + y) / (2 * d)) *
175 return base::_f < 0 ?
176 Datan(base::_e * base::sn(x), base::_e * base::sn(y)) * Dsn(x, y) :
177 Dasinh(base::_e1 * base::sn(base::_fm1 * x),
178 base::_e1 * base::sn(base::_fm1 * y)) *
179 Dsn(base::_fm1 * x, base::_fm1 * y);
187 using std::isnan;
using std::isinf;
188 real tphi1 = phi1.
tan(), tphi2 = phi2.
tan();
189 return isnan(tphi1) || isnan(tphi2) ? numeric_limits<real>::quiet_NaN() :
190 (isinf(tphi1) || isinf(tphi2) ? numeric_limits<real>::infinity() :
191 (Dasinh(tphi1, tphi2) - base::_e2 * Datanhee(tphi1, tphi2)) /
192 Datan(tphi1, tphi2));
200 int k = base::ind(auxout, auxin);
201 if (k < 0)
return numeric_limits<real>::quiet_NaN();
202 if (auxin == auxout)
return 1;
203 if ( isnan(base::_c[
base::Lmax * (k + 1) - 1]) )
204 base::fillcoeff(auxin, auxout, k);
207 zeta1n.y(), zeta1n.x(), zeta2n.
y(), zeta2n.
x(),
212 real szeta1, real czeta1,
213 real szeta2, real czeta2,
214 const real c[],
int K) {
229 real D2 = Delta * Delta,
230 czetap = czeta2 * czeta1 - szeta2 * szeta1,
231 szetap = szeta2 * czeta1 + czeta2 * szeta1,
232 czetam = czeta2 * czeta1 + szeta2 * szeta1,
234 szetamd = (Delta == 1 ? szeta2 * czeta1 - czeta2 * szeta1 :
235 (Delta != 0 ? sin(Delta) / Delta : 1)),
236 Xa = 2 * czetap * czetam,
237 Xb = -2 * szetap * szetamd,
238 u0a = 0, u0b = 0, u1a = 0, u1b = 0;
239 for (--k; k >= 0; --k) {
241 real ta = Xa * u0a + D2 * Xb * u0b - u1a + c[k],
242 tb = Xb * u0a + Xa * u0b - u1b;
258 real F0a = (sinp ? szetap : czetap) * czetam,
259 F0b = (sinp ? czetap : -szetap) * szetamd,
263 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.