14 # pragma warning (disable: 4127) 31 static const real tolRF =
51 X = (A0 -
x) / (
mul * An),
52 Y = (A0 -
y) / (
mul * An),
61 return (E3 * (6930 * E3 +
E2 * (15015 *
E2 - 16380) + 17160) +
62 E2 * ((10010 - 5775 *
E2) *
E2 - 24024) + 240240) /
68 static const real tolRG0 =
71 if (xn < yn)
swap(xn, yn);
72 while (
abs(xn-yn) > tolRG0 * xn) {
74 real t = (xn + yn) /2;
86 ( x == y ? 1 /
sqrt(y) :
100 return (z * RF(x, y, z) - (x-z) * (y-z) * RD(x, y, z) / 3
101 +
sqrt(x * y / z)) / 2;
106 static const real tolRG0 =
115 while (
abs(xn-yn) > tolRG0 * xn) {
117 real t = (xn + yn) /2;
133 A0 = (x + y + z + 2*
p)/5,
135 delta = (p-x) * (p-
y) * (p-z),
144 while (
Q >= mul *
abs(An)) {
150 s += RC(1, 1 + e0)/(mul * d0);
160 X = (A0 -
x) / (mul * An),
161 Y = (A0 -
y) / (mul * An),
162 Z = (A0 -
z) / (mul * An),
163 P = -(X +
Y +
Z) / 2,
165 E3 = X*
Y*
Z + 2*P * (
E2 + 2*P*P),
166 E4 = (2*X*
Y*
Z + P * (
E2 + 3*P*
P)) *
P,
173 return ((471240 - 540540 *
E2) * E5 +
174 (612612 *
E2 - 540540 * E3 - 556920) * E4 +
175 E3 * (306306 * E3 +
E2 * (675675 *
E2 - 706860) + 680680) +
176 E2 * ((417690 - 255255 *
E2) *
E2 - 875160) + 4084080) /
177 (4084080 * mul * An *
sqrt(An)) + 6 *
s;
186 A0 = (x + y + 3*
z)/5,
197 s += 1/(
mul *
sqrt(z0) * (z0 + lam));
205 X = (A0 -
x) / (
mul * An),
206 Y = (A0 -
y) / (
mul * An),
209 E3 = (3*X*
Y - 8*Z*Z)*
Z,
210 E4 = 3 * (X*
Y - Z*
Z) * Z*Z,
217 return ((471240 - 540540 *
E2) * E5 +
218 (612612 *
E2 - 540540 * E3 - 556920) * E4 +
219 E3 * (306306 * E3 +
E2 * (675675 *
E2 - 706860) + 680680) +
220 E2 * ((417690 - 255255 *
E2) *
E2 - 875160) + 4084080) /
221 (4084080 *
mul * An *
sqrt(An)) + 3 *
s;
268 _Ec = _kp2 != 0 ? 2 * RG(_kp2, 1) : 1;
273 _Kc = _Ec =
Math::pi()/2; _Dc = _Kc/2;
277 real rj = (_kp2 != 0 && _alphap2 != 0) ? RJ(0, _kp2, 1, _alphap2) :
285 _Gc = _kp2 != 0 ? _Kc + (_alpha2 - _k2) * rj / 3 : rc;
287 _Hc = _kp2 != 0 ? _Kc - (_alphap2 != 0 ? _alphap2 * rj : 0) / 3 : rc;
289 _Pic = _Kc; _Gc = _Ec;
303 _Hc = _kp2 != 0 ? _kp2 * RD(0, 1, _kp2) / 3 : 1;
317 static const real tolJAC =
320 real mc = _kp2,
d = 0;
333 n[
l] = mc =
sqrt(mc);
335 if (!(
abs(
a - mc) > tolJAC *
a)) {
353 dn = (n[
l] +
a) / (b + a);
356 a = 1 /
sqrt(c*c + 1);
357 sn = sn < 0 ? -
a :
a;
366 dn = cn = 1 /
cosh(x);
373 real cn2 = cn*cn, dn2 = dn*dn,
374 fi = cn2 != 0 ?
abs(sn) * RF(cn2, dn2, 1) :
K();
383 cn2 = cn*cn, dn2 = dn*dn, sn2 = sn*sn,
385 abs(sn) * ( _k2 <= 0 ?
388 RF(cn2, dn2, 1) - _k2 * sn2 * RD(cn2, dn2, 1) / 3 :
391 _kp2 * RF(cn2, dn2, 1) +
392 _k2 * _kp2 * sn2 * RD(cn2, 1, dn2) / 3 +
395 - _kp2 * sn2 * RD(dn2, 1, cn2) / 3 +
408 cn2 = cn*cn, dn2 = dn*dn, sn2 = sn*sn,
409 di = cn2 != 0 ?
abs(sn) * sn2 * RD(cn2, dn2, 1) / 3 :
D();
420 cn2 = cn*cn, dn2 = dn*dn, sn2 = sn*sn,
421 pii = cn2 != 0 ?
abs(sn) * (RF(cn2, dn2, 1) +
423 RJ(cn2, dn2, 1, cn2 + _alphap2 * sn2) / 3) :
427 pii = 2 * Pi() - pii;
433 cn2 = cn*cn, dn2 = dn*dn, sn2 = sn*sn,
434 gi = cn2 != 0 ?
abs(sn) * (RF(cn2, dn2, 1) +
435 (_alpha2 - _k2) * sn2 *
436 RJ(cn2, dn2, 1, cn2 + _alphap2 * sn2) / 3) :
446 cn2 = cn*cn, dn2 = dn*dn, sn2 = sn*sn,
448 hi = cn2 != 0 ?
abs(sn) * (RF(cn2, dn2, 1) -
450 RJ(cn2, dn2, 1, cn2 + _alphap2 * sn2) / 3) :
460 if (cn < 0) { cn = -cn; sn = -sn; }
466 if (cn < 0) { cn = -cn; sn = -sn; }
472 if (cn < 0) { cn = -cn; sn = -sn; }
473 return Pi(sn, cn, dn) * (
Math::pi()/2) / Pi() -
atan2(sn, cn);
478 if (cn < 0) { cn = -cn; sn = -sn; }
484 if (cn < 0) { cn = -cn; sn = -sn; }
490 if (cn < 0) { cn = -cn; sn = -sn; }
495 real sn =
sin(phi), cn =
cos(phi), dn = Delta(sn, cn);
497 (deltaF(sn, cn, dn) + phi) *
K() / (
Math::pi()/2);
501 real sn =
sin(phi), cn =
cos(phi), dn = Delta(sn, cn);
503 (deltaE(sn, cn, dn) + phi) *
E() / (
Math::pi()/2);
511 return E(sn, cn, Delta(sn, cn)) + 4 *
E() *
n;
515 real sn =
sin(phi), cn =
cos(phi), dn = Delta(sn, cn);
517 (deltaPi(sn, cn, dn) + phi) * Pi() / (
Math::pi()/2);
521 real sn =
sin(phi), cn =
cos(phi), dn = Delta(sn, cn);
523 (deltaD(sn, cn, dn) + phi) *
D() / (
Math::pi()/2);
527 real sn =
sin(phi), cn =
cos(phi), dn = Delta(sn, cn);
529 (deltaG(sn, cn, dn) + phi) *
G() / (
Math::pi()/2);
533 real sn =
sin(phi), cn =
cos(phi), dn = Delta(sn, cn);
535 (deltaH(sn, cn, dn) + phi) *
H() / (
Math::pi()/2);
539 static const real tolJAC =
546 phi -= _eps *
sin(2 * phi) / 2;
555 err = (
E(sn, cn, dn) -
x)/dn;
557 if (
abs(err) < tolJAC)
565 if (ctau < 0) { ctau = -ctau; stau = -stau; }
567 return Einv( tau *
E() / (
Math::pi()/2) ) - tau;
void sncndn(real x, real &sn, real &cn, real &dn) const
Jet< T, N > cos(const Jet< T, N > &f)
void Reset(real k2=0, real alpha2=0)
JacobiRotation< float > G
double mul(const double &a, const double &b)
Math::real deltaPi(real sn, real cn, real dn) const
Math::real deltaE(real sn, real cn, real dn) const
EIGEN_DEVICE_FUNC const TanhReturnType tanh() const
Jet< T, N > sin(const Jet< T, N > &f)
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
static void sincosd(T x, T &sinx, T &cosx)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange [*:*] noreverse nowriteback set trange [*:*] noreverse nowriteback set urange [*:*] noreverse nowriteback set vrange [*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
EIGEN_DEVICE_FUNC const AtanReturnType atan() const
static real RG(real x, real y, real z)
EIGEN_DEVICE_FUNC const FloorReturnType floor() const
static const Line3 l(Rot3(), 1, 1)
int EIGEN_BLAS_FUNC() swap(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
static real RF(real x, real y, real z)
static real RC(real x, real y)
Namespace for GeographicLib.
Header for GeographicLib::EllipticFunction class.
Math::real F(real phi) const
Math::real deltaH(real sn, real cn, real dn) const
AnnoyingScalar atan2(const AnnoyingScalar &y, const AnnoyingScalar &x)
Math::real deltaG(real sn, real cn, real dn) const
Math::real Ed(real ang) const
static T copysign(T x, T y)
Math::real Einv(real x) const
Exception handling for GeographicLib.
The quaternion class used to represent 3D orientations and rotations.
Math::real deltaD(real sn, real cn, real dn) const
static real RD(real x, real y, real z)
Jet< T, N > sqrt(const Jet< T, N > &f)
Jet< T, N > pow(const Jet< T, N > &f, double g)
Math::real deltaEinv(real stau, real ctau) const
static real RJ(real x, real y, real z, real p)
EIGEN_DEVICE_FUNC const CoshReturnType cosh() const
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
EIGEN_DEVICE_FUNC const CeilReturnType ceil() const
#define GEOGRAPHICLIB_PANIC
Math::real deltaF(real sn, real cn, real dn) const