50 , _es((f < 0 ? -1 : 1) *
sqrt(
abs(_e2)))
65 #if GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER/2 == 2 66 static const real b1coeff[] = {
70 #elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER/2 == 3 71 static const real b1coeff[] = {
75 #elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER/2 == 4 76 static const real b1coeff[] = {
78 25, 64, 256, 4096, 16384, 16384,
81 #error "Bad value for GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER" 84 #if GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 4 85 static const real alpcoeff[] = {
87 164, 225, -480, 360, 720,
95 #elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 5 96 static const real alpcoeff[] = {
98 -635, 328, 450, -960, 720, 1440,
100 4496, 3899, -6048, 2730, 10080,
102 15061, -19776, 6832, 26880,
104 -171840, 49561, 161280,
108 #elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 6 109 static const real alpcoeff[] = {
111 31564, -66675, 34440, 47250, -100800, 75600, 151200,
113 -1983433, 863232, 748608, -1161216, 524160, 1935360,
115 670412, 406647, -533952, 184464, 725760,
117 6601661, -7732800, 2230245, 7257600,
119 -13675556, 3438171, 7983360,
121 212378941, 319334400,
123 #elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 7 124 static const real alpcoeff[] = {
126 1804025, 2020096, -4267200, 2204160, 3024000, -6451200, 4838400, 9676800,
128 4626384, -9917165, 4316160, 3743040, -5806080, 2620800, 9676800,
130 -67102379, 26816480, 16265880, -21358080, 7378560, 29030400,
132 155912000, 72618271, -85060800, 24532695, 79833600,
134 102508609, -109404448, 27505368, 63866880,
136 -12282192400LL, 2760926233LL, 4151347200LL,
138 1522256789, 1383782400,
140 #elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 8 141 static const real alpcoeff[] = {
143 -75900428, 37884525, 42422016, -89611200, 46287360, 63504000, -135475200,
144 101606400, 203212800,
146 148003883, 83274912, -178508970, 77690880, 67374720, -104509440,
149 318729724, -738126169, 294981280, 178924680, -234938880, 81164160,
152 -40176129013LL, 14967552000LL, 6971354016LL, -8165836800LL, 2355138720LL,
155 10421654396LL, 3997835751LL, -4266773472LL, 1072709352, 2490808320LL,
157 175214326799LL, -171950693600LL, 38652967262LL, 58118860800LL,
159 -67039739596LL, 13700311101LL, 12454041600LL,
161 1424729850961LL, 743921418240LL,
164 #error "Bad value for GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER" 167 #if GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 4 168 static const real betcoeff[] = {
170 -4, 555, -960, 720, 1440,
178 #elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 5 179 static const real betcoeff[] = {
181 -3645, -64, 8880, -15360, 11520, 23040,
183 4416, -3059, 672, 210, 10080,
185 -627, -592, 476, 13440,
191 #elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 6 192 static const real betcoeff[] = {
194 384796, -382725, -6720, 932400, -1612800, 1209600, 2419200,
196 -1118711, 1695744, -1174656, 258048, 80640, 3870720,
198 22276, -16929, -15984, 12852, 362880,
200 -830251, -158400, 197865, 7257600,
202 -435388, 453717, 15966720,
206 #elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 7 207 static const real betcoeff[] = {
209 -5406467, 6156736, -6123600, -107520, 14918400, -25804800, 19353600,
212 829456, -5593555, 8478720, -5873280, 1290240, 403200, 19353600,
214 9261899, 3564160, -2708640, -2557440, 2056320, 58060800,
216 14928352, -9132761, -1742400, 2176515, 79833600,
218 -8005831, -1741552, 1814868, 63866880,
220 -261810608, 268433009, 8302694400LL,
222 219941297, 5535129600LL,
224 #elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 8 225 static const real betcoeff[] = {
227 31777436, -37845269, 43097152, -42865200, -752640, 104428800, -180633600,
228 135475200, 270950400,
230 24749483, 14930208, -100683990, 152616960, -105719040, 23224320, 7257600,
233 -232468668, 101880889, 39205760, -29795040, -28131840, 22619520,
236 324154477, 1433121792, -876745056, -167270400, 208945440, 7664025600LL,
238 457888660, -312227409, -67920528, 70779852, 2490808320LL,
240 -19841813847LL, -3665348512LL, 3758062126LL, 116237721600LL,
242 -1989295244, 1979471673, 49816166400LL,
244 191773887257LL, 3719607091200LL,
247 #error "Bad value for GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER" 250 GEOGRAPHICLIB_STATIC_ASSERT(
sizeof(b1coeff) /
sizeof(
real) ==
252 "Coefficient array size mismatch for b1");
253 GEOGRAPHICLIB_STATIC_ASSERT(
sizeof(alpcoeff) /
sizeof(
real) ==
255 "Coefficient array size mismatch for alp");
256 GEOGRAPHICLIB_STATIC_ASSERT(
sizeof(betcoeff) /
sizeof(
real) ==
258 "Coefficient array size mismatch for bet");
357 latsign = (lat < 0) ? -1 : 1,
358 lonsign = (lon < 0) ? -1 : 1;
361 bool backside = lon > 90;
367 real sphi, cphi, slam, clam;
392 xip =
atan2(taup, clam);
482 c0 =
cos(2 * xip), ch0 =
cosh(2 * etap),
483 s0 =
sin(2 * xip), sh0 =
sinh(2 * etap);
487 y0(n & 1 ?
_alp[n] : 0), y1,
488 z0(n & 1 ? 2*n *
_alp[n] : 0),
z1;
491 y1 = a * y0 - y1 +
_alp[
n];
492 z1 = a * z0 - z1 + 2*n * _alp[
n];
494 y0 = a * y1 - y0 + _alp[
n];
495 z0 = a * z1 - z0 + 2*n * _alp[
n];
499 z1 =
real(1) - z1 + a * z0;
506 real xi = y1.real(), eta = y1.imag();
508 x =
_a1 *
_k0 * eta * lonsign;
511 gamma *= latsign * lonsign;
527 xisign = (xi < 0) ? -1 : 1,
528 etasign = (eta < 0) ? -1 : 1;
535 c0 =
cos(2 * xi), ch0 =
cosh(2 * eta),
536 s0 =
sin(2 * xi), sh0 =
sinh(2 * eta);
540 y0(n & 1 ? -
_bet[n] : 0), y1,
541 z0(n & 1 ? -2*n *
_bet[n] : 0),
z1;
544 y1 = a * y0 - y1 -
_bet[
n];
545 z1 = a * z0 - z1 - 2*n * _bet[
n];
547 y0 = a * y1 - y0 - _bet[
n];
548 z0 = a * z1 - z0 - 2*n * _bet[
n];
552 z1 =
real(1) - z1 + a * z0;
564 xip = y1.real(), etap = y1.imag(),
591 gamma *= xisign * etasign;
static T AngNormalize(T x)
EIGEN_DEVICE_FUNC const ExpReturnType exp() const
static bool isfinite(T x)
EIGEN_DEVICE_FUNC const TanhReturnType tanh() const
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
EIGEN_DEVICE_FUNC const CoshReturnType cosh() const
Mathematical functions needed by GeographicLib.
static void sincosd(T x, T &sinx, T &cosx)
void Forward(real lon0, real lat, real lon, real &x, real &y, real &gamma, real &k) const
static T AngDiff(T x, T y, T &e)
Transverse Mercator projection.
static const TransverseMercator & UTM()
Header for GeographicLib::TransverseMercator class.
EIGEN_DEVICE_FUNC const CosReturnType cos() const
TransverseMercator(real a, real f, real k0)
static const Line3 l(Rot3(), 1, 1)
const mpreal gamma(const mpreal &x, mp_rnd_t r=mpreal::get_default_rnd())
EIGEN_DEVICE_FUNC const SinhReturnType sinh() const
static T atan2d(T y, T x)
static T polyval(int N, const T p[], T x)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Namespace for GeographicLib.
void Reverse(real lon0, real x, real y, real &lat, real &lon, real &gamma, real &k) const
Jet< T, N > atan2(const Jet< T, N > &g, const Jet< T, N > &f)
Exception handling for GeographicLib.
EIGEN_DEVICE_FUNC const SinReturnType sin() const
static T tauf(T taup, T es)
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)