46 # pragma warning (disable: 4127) 56 , tol2_(
real(0.1) * tol_)
98 t1 = (d1 != 0 ? snu * dnv / d1 : (snu < 0 ? -overflow : overflow)),
100 (snu < 0 ? -overflow : overflow));
104 lam = (d1 != 0 &&
d2 != 0) ?
105 atan2(dnu * snv, cnu * cnv) -
_e *
atan2(
_e * cnu * snv, dnu * cnv) :
197 real snu, cnu, dnu, snv, cnv, dnv;
200 real tau1, lam1, du1, dv1;
201 zeta(u, snu, cnu, dnu, v, snv, cnv, dnv, tau1, lam1);
202 dwdzeta(u, snu, cnu, dnu, v, snv, cnv, dnv, du1, dv1);
207 delu = tau1 * du1 - lam1 * dv1,
208 delv = tau1 * dv1 + lam1 * du1;
214 if (!(delw2 >= stol2))
225 xi =
_Eu.
E(snu, cnu, dnu) -
_mu * snu * cnu * dnu /
d;
226 eta = v -
_Ev.
E(snv, cnv, dnv) +
_mv * snv * cnv * dnv /
d;
238 dnr = dnu * cnv * dnv,
239 dni = -
_mu * snu * cnu * snv;
241 dv = 2 * dnr * dni /
d;
275 deta = eta -
_Ev.
KE(),
301 real snu, cnu, dnu, snv, cnv, dnv;
304 real xi1, eta1, du1, dv1;
305 sigma(u, snu, cnu, dnu, v, snv, cnv, dnv, xi1, eta1);
306 dwdsigma(u, snu, cnu, dnu, v, snv, cnv, dnv, du1, dv1);
310 delu = xi1 * du1 - eta1 * dv1,
311 delv = xi1 * dv1 + eta1 * du1;
317 if (!(delw2 >=
tol2_))
329 gamma =
atan2(
_mv * snu * snv * cnv, cnu * dnu * dnv);
355 latsign = (!
_extendp && lat < 0) ? -1 : 1,
356 lonsign = (!
_extendp && lon < 0) ? -1 : 1;
359 bool backside = !
_extendp && lon > 90;
374 }
else if (lat == 0 && lon == 90 * (1 -
_e)) {
381 real snu, cnu, dnu, snv, cnv, dnv;
386 sigma(u, snu, cnu, dnu, v, snv, cnv, dnv, xi, eta);
389 y = xi *
_a *
_k0 * latsign;
390 x = eta *
_a *
_k0 * lonsign;
397 zeta(u, snu, cnu, dnu, v, snv, cnv, dnv, tau, lam);
399 Scale(tau, lam, snu, cnu, dnu, snv, cnv, dnv, gamma, k);
404 gamma *= latsign * lonsign;
414 eta = x / (
_a *
_k0);
417 latsign = !
_extendp && y < 0 ? -1 : 1,
418 lonsign = !
_extendp && x < 0 ? -1 : 1;
427 if (xi == 0 && eta ==
_Ev.
KE()) {
433 real snu, cnu, dnu, snv, cnv, dnv;
437 if (v != 0 || u !=
_Eu.
K()) {
438 zeta(u, snu, cnu, dnu, v, snv, cnv, dnv, tau, lam);
443 Scale(tau, lam, snu, cnu, dnu, snv, cnv, dnv, gamma, k);
447 lon = lam = gamma = 0;
458 gamma *= latsign * lonsign;
static T AngNormalize(T x)
void sncndn(real x, real &sn, real &cn, real &dn) const
Jet< T, N > cos(const Jet< T, N > &f)
static const TransverseMercatorExact & UTM()
An exact implementation of the transverse Mercator projection.
void sigmainv(real xi, real eta, real &u, real &v) const
static bool isfinite(T x)
void dwdzeta(real u, real snu, real cnu, real dnu, real v, real snv, real cnv, real dnv, real &du, real &dv) const
Jet< T, N > sin(const Jet< T, N > &f)
Header for GeographicLib::TransverseMercatorExact class.
static T AngDiff(T x, T y, T &e)
void Reverse(real lon0, real x, real y, real &lat, real &lon, real &gamma, real &k) const
EIGEN_DEVICE_FUNC const SinhReturnType sinh() const
bool sigmainv0(real xi, real eta, real &u, real &v) const
EIGEN_DEVICE_FUNC const AtanReturnType atan() const
TransverseMercatorExact(real a, real f, real k0, bool extendp=false)
void Scale(real tau, real lam, real snu, real cnu, real dnu, real snv, real cnv, real dnv, real &gamma, real &k) const
bool zetainv0(real psi, real lam, real &u, real &v) const
void sigma(real u, real snu, real cnu, real dnu, real v, real snv, real cnv, real dnv, real &xi, real &eta) const
Array< int, Dynamic, 1 > v
void zeta(real u, real snu, real cnu, real dnu, real v, real snv, real cnv, real dnv, real &taup, real &lam) const
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Namespace for GeographicLib.
AnnoyingScalar atan2(const AnnoyingScalar &y, const AnnoyingScalar &x)
void Forward(real lon0, real lat, real lon, real &x, real &y, real &gamma, real &k) const
Exception handling for GeographicLib.
void dwdsigma(real u, real snu, real cnu, real dnu, real v, real snv, real cnv, real dnv, real &du, real &dv) const
Jet< T, N > sqrt(const Jet< T, N > &f)
static T tauf(T taup, T es)
Jet< T, N > pow(const Jet< T, N > &f, double g)
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
static T taupf(T tau, T es)
#define GEOGRAPHICLIB_PANIC
void zetainv(real taup, real lam, real &u, real &v) const
int EIGEN_BLAS_FUNC() scal(int *n, RealScalar *palpha, RealScalar *px, int *incx)