54 , _es((_f < 0 ? -1 : 1) * sqrt(fabs(_e2)))
58 , _c( sqrt(_e2m) * exp(
Math::eatanhe(real(1), _es)) )
61 if (!(isfinite(_a) && _a > 0))
63 if (!(isfinite(_f) && _f < 1))
65 if (!(isfinite(_k0) && _k0 > 0))
69#if GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER/2 == 2
70 static const real b1coeff[] = {
74#elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER/2 == 3
75 static const real b1coeff[] = {
79#elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER/2 == 4
80 static const real b1coeff[] = {
82 25, 64, 256, 4096, 16384, 16384,
85#error "Bad value for GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER"
88#if GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 4
89 static const real alpcoeff[] = {
91 164, 225, -480, 360, 720,
99#elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 5
100 static const real alpcoeff[] = {
102 -635, 328, 450, -960, 720, 1440,
104 4496, 3899, -6048, 2730, 10080,
106 15061, -19776, 6832, 26880,
108 -171840, 49561, 161280,
112#elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 6
113 static const real alpcoeff[] = {
115 31564, -66675, 34440, 47250, -100800, 75600, 151200,
117 -1983433, 863232, 748608, -1161216, 524160, 1935360,
119 670412, 406647, -533952, 184464, 725760,
121 6601661, -7732800, 2230245, 7257600,
123 -13675556, 3438171, 7983360,
125 212378941, 319334400,
127#elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 7
128 static const real alpcoeff[] = {
130 1804025, 2020096, -4267200, 2204160, 3024000, -6451200, 4838400, 9676800,
132 4626384, -9917165, 4316160, 3743040, -5806080, 2620800, 9676800,
134 -67102379, 26816480, 16265880, -21358080, 7378560, 29030400,
136 155912000, 72618271, -85060800, 24532695, 79833600,
138 102508609, -109404448, 27505368, 63866880,
140 -12282192400LL, 2760926233LL, 4151347200LL,
142 1522256789, 1383782400,
144#elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 8
145 static const real alpcoeff[] = {
147 -75900428, 37884525, 42422016, -89611200, 46287360, 63504000, -135475200,
148 101606400, 203212800,
150 148003883, 83274912, -178508970, 77690880, 67374720, -104509440,
153 318729724, -738126169, 294981280, 178924680, -234938880, 81164160,
156 -40176129013LL, 14967552000LL, 6971354016LL, -8165836800LL, 2355138720LL,
159 10421654396LL, 3997835751LL, -4266773472LL, 1072709352, 2490808320LL,
161 175214326799LL, -171950693600LL, 38652967262LL, 58118860800LL,
163 -67039739596LL, 13700311101LL, 12454041600LL,
165 1424729850961LL, 743921418240LL,
168#error "Bad value for GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER"
171#if GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 4
172 static const real betcoeff[] = {
174 -4, 555, -960, 720, 1440,
182#elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 5
183 static const real betcoeff[] = {
185 -3645, -64, 8880, -15360, 11520, 23040,
187 4416, -3059, 672, 210, 10080,
189 -627, -592, 476, 13440,
195#elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 6
196 static const real betcoeff[] = {
198 384796, -382725, -6720, 932400, -1612800, 1209600, 2419200,
200 -1118711, 1695744, -1174656, 258048, 80640, 3870720,
202 22276, -16929, -15984, 12852, 362880,
204 -830251, -158400, 197865, 7257600,
206 -435388, 453717, 15966720,
210#elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 7
211 static const real betcoeff[] = {
213 -5406467, 6156736, -6123600, -107520, 14918400, -25804800, 19353600,
216 829456, -5593555, 8478720, -5873280, 1290240, 403200, 19353600,
218 9261899, 3564160, -2708640, -2557440, 2056320, 58060800,
220 14928352, -9132761, -1742400, 2176515, 79833600,
222 -8005831, -1741552, 1814868, 63866880,
224 -261810608, 268433009, 8302694400LL,
226 219941297, 5535129600LL,
228#elif GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER == 8
229 static const real betcoeff[] = {
231 31777436, -37845269, 43097152, -42865200, -752640, 104428800, -180633600,
232 135475200, 270950400,
234 24749483, 14930208, -100683990, 152616960, -105719040, 23224320, 7257600,
237 -232468668, 101880889, 39205760, -29795040, -28131840, 22619520,
240 324154477, 1433121792, -876745056, -167270400, 208945440, 7664025600LL,
242 457888660, -312227409, -67920528, 70779852, 2490808320LL,
244 -19841813847LL, -3665348512LL, 3758062126LL, 116237721600LL,
246 -1989295244, 1979471673, 49816166400LL,
248 191773887257LL, 3719607091200LL,
251#error "Bad value for GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER"
254 static_assert(
sizeof(b1coeff) /
sizeof(real) == maxpow_/2 + 2,
255 "Coefficient array size mismatch for b1");
256 static_assert(
sizeof(alpcoeff) /
sizeof(real) ==
257 (maxpow_ * (maxpow_ + 3))/2,
258 "Coefficient array size mismatch for alp");
259 static_assert(
sizeof(betcoeff) /
sizeof(real) ==
260 (maxpow_ * (maxpow_ + 3))/2,
261 "Coefficient array size mismatch for bet");
269 for (
int l = 1; l <= maxpow_; ++l) {
271 _alp[l] = d *
Math::polyval(m, alpcoeff + o, _n) / alpcoeff[o + m + 1];
272 _bet[l] = d *
Math::polyval(m, betcoeff + o, _n) / betcoeff[o + m + 1];