21 , _c2(_ell.Area() / 720)
23 real n = _ell._n, nx = n;
26 _R[1] = nx*(n*(n*(1772*n-5340)+6930)-4725)/14175;
28 _R[2] = nx*((1590-1747*n)*n-630)/4725;
30 _R[3] = nx*(104*n-31)/315;
35 _R[1] = nx*(n*(n*(n*(41662*n+58476)-176220)+228690)-155925)/467775;
37 _R[2] = nx*(n*(n*(18118*n-57651)+52470)-20790)/155925;
39 _R[3] = nx*((17160-23011*n)*n-5115)/51975;
41 _R[4] = nx*(5480*n-1353)/13860;
46 _R[1] = nx*(n*(n*(n*((56868630-114456994*n)*n+79819740)-240540300)+
47 312161850)-212837625)/638512875;
49 _R[2] = nx*(n*(n*(n*(51304574*n+24731070)-78693615)+71621550)-28378350)/
52 _R[3] = nx*(n*(n*(1554472*n-6282003)+4684680)-1396395)/14189175;
54 _R[4] = nx*((3205800-4913956*n)*n-791505)/8108100;
56 _R[5] = nx*(1092376*n-234468)/2027025;
58 _R[6] = -313076*nx/2027025;
61 _R[1] = nx*(n*(n*(n*(n*(n*(258618446*n-343370982)+170605890)+239459220)-
62 721620900)+936485550)-638512875)/1915538625;
64 _R[2] = nx*(n*(n*(n*((153913722-248174686*n)*n+74193210)-236080845)+
65 214864650)-85135050)/638512875;
67 _R[3] = nx*(n*(n*(n*(114450437*n+23317080)-94230045)+70270200)-20945925)/
70 _R[4] = nx*(n*(n*(15445736*n-103193076)+67321800)-16621605)/170270100;
72 _R[5] = nx*((16385640-27766753*n)*n-3517020)/30405375;
74 _R[6] = nx*(4892722*n-939228)/6081075;
76 _R[7] = -3189007*nx/14189175;
79 _R[1] = nx*(n*(n*(n*(n*(n*((65947703730LL-13691187484LL*n)*n-
80 87559600410LL)+43504501950LL)+61062101100LL)-
81 184013329500LL)+238803815250LL)-162820783125LL)/
84 _R[2] = nx*(n*(n*(n*(n*(n*(30802104839LL*n-63284544930LL)+39247999110LL)+
85 18919268550LL)-60200615475LL)+54790485750LL)-
86 21709437750LL)/162820783125LL;
88 _R[3] = nx*(n*(n*(n*((5836972287LL-8934064508LL*n)*n+1189171080)-
89 4805732295LL)+3583780200LL)-1068242175)/10854718875LL;
91 _R[4] = nx*(n*(n*(n*(50072287748LL*n+3938662680LL)-26314234380LL)+
92 17167059000LL)-4238509275LL)/43418875500LL;
94 _R[5] = nx*(n*(n*(359094172*n-9912730821LL)+5849673480LL)-1255576140)/
97 _R[6] = nx*((8733508770LL-16053944387LL*n)*n-1676521980)/10854718875LL;
99 _R[7] = nx*(930092876*n-162639357)/723647925;
101 _R[8] = -673429061*nx/1929727800;
104 GEOGRAPHICLIB_STATIC_ASSERT(maxpow_ >= 4 && maxpow_ <= 8,
105 "Bad value of maxpow_");
114 void Rhumb::GenInverse(real lat1, real lon1, real lat2, real lon2,
116 real& s12, real& azi12, real& S12)
const {
126 real dmudpsi = DIsometricToRectifying(psi2, psi1);
135 {
return RhumbLine(*
this, lat1, lon1, azi12, _exact); }
137 void Rhumb::GenDirect(real lat1, real lon1, real azi12, real s12,
139 real& lat2, real& lon2, real& S12)
const
140 {
Line(lat1, lon1, azi12).
GenPosition(s12, outmask, lat2, lon2, S12); }
146 return d ? (ei.
E(x) - ei.
E(y)) / d : 1;
162 real sx = sin(x), sy = sin(y), cx = cos(x), cy = cos(y);
163 real Dt = Dsin(x, y) * (sx + sy) /
164 ((cx + cy) * (sx * ei.
Delta(sy, cy) + sy * ei.
Delta(sx, cx))),
165 t = d * Dt, Dsz = 2 * Dt / (1 + t*t),
166 sz = d * Dsz, cz = (1 - t) * (1 + t) / (1 + t*t);
167 return ((sz ? ei.
E(sz, cz, ei.
Delta(sz, cz)) / sz : 1)
168 - ei.
k2() * sx * sy) * Dsz;
175 return (
Math::pi()/2) * _ell._b * _ell._f1 * DE(atan(tbetx), atan(tbety))
183 return Dasinh(tx, ty) * Dtan(latx, laty)
184 - Deatanhe(sin(phix), sin(phiy)) * Dsin(phix, phiy);
222 real p = x + y, d = x - y,
223 cp = cos(p), cd = cos(d),
224 sp = sin(p), sd = d ? sin(d)/d : 1,
225 m = 2 * cp * cd, s = sp * sd;
227 const real a[4] = {m, -s * d * d, -4 * s, m};
228 real ba[4] = {0, 0, 0, 0};
229 real bb[4] = {0, 0, 0, 0};
232 if (n > 0) b1[0] = b1[3] = c[n];
233 for (
int j = n - 1; j > 0; --j) {
236 b1[0] = a[0] * b2[0] + a[1] * b2[2] - b1[0] + c[j];
237 b1[1] = a[0] * b2[1] + a[1] * b2[3] - b1[1];
238 b1[2] = a[2] * b2[0] + a[3] * b2[2] - b1[2];
239 b1[3] = a[2] * b2[1] + a[3] * b2[3] - b1[3] + c[j];
246 real f11 = cd * sp, f12 = 2 * sd * cp;
248 s = b1[2] * f11 + b1[3] * f12;
251 real f11 = cd * cp, f12 = - 2 * sd * sp;
253 s = - b2[2] + b1[2] * f11 + b1[3] * f12;
259 return 1 + SinCosSeries(
true, chix, chiy,
260 _ell.ConformalToRectifyingCoeffs(), tm_maxord);
264 return 1 - SinCosSeries(
true, mux, muy,
265 _ell.RectifyingToConformalCoeffs(), tm_maxord);
273 return DRectifying(latx, laty) / DIsometric(latx, laty);
277 return DConformalToRectifying(gd(psix), gd(psiy)) * Dgd(psix, psiy);
286 DIsometric(latx, laty) / DRectifying(latx, laty) :
287 Dgdinv(Math::taupf(Math::tand(latx), _ell._es),
288 Math::taupf(Math::tand(laty), _ell._es)) *
289 DRectifyingToConformal(mux, muy);
293 return Dlog(cosh(psix), cosh(psiy)) * Dcosh(psix, psiy)
294 + SinCosSeries(
false, gd(psix), gd(psiy), _R, maxpow_) * Dgd(psix, psiy);
297 RhumbLine::RhumbLine(
const Rhumb& rh,
real lat1,
real lon1,
real azi12,
303 , _azi12(Math::AngNormalize(azi12))
306 _salp = _azi12 == -180 ? 0 : sin(alp12);
307 _calp = abs(_azi12) == 90 ? 0 : cos(alp12);
308 _mu1 = _rh._ell.RectifyingLatitude(lat1);
309 _psi1 = _rh._ell.IsometricLatitude(lat1);
310 _r1 = _rh._ell.CircleRadius(lat1);
314 real& lat2, real& lon2, real& S12)
const {
318 real psi2, lat2x, lon2x;
319 if (abs(mu2) <= 90) {
322 real psi12 = _rh.DRectifyingToIsometric( mu2 *
Math::degree(),
324 lon2x = _salp * psi12 / _calp;
325 psi2 = _psi1 + psi12;
332 S12 = _rh._c2 * lon2x *
346 if (outmask &
LATITUDE) lat2 = lat2x;
static T AngNormalize(T x)
Math::real InverseRectifyingLatitude(real mu) const
Math::real IsometricLatitude(real phi) const
GeographicLib::Math::real real
Rhumb(real a, real f, bool exact=true)
void GenPosition(real s12, unsigned outmask, real &lat2, real &lon2, real &S12) const
Header for GeographicLib::Rhumb and GeographicLib::RhumbLine classes.
Elliptic integrals and functions.
Math::real Delta(real sn, real cn) const
static const Rhumb & WGS84()
RhumbLine Line(real lat1, real lon1, real azi12) const
static T atan2d(T y, T x)
Namespace for GeographicLib.
Math::real QuarterMeridian() const
static T AngDiff(T x, T y)
Math::real InverseIsometricLatitude(real psi) const
Solve of the direct and inverse rhumb problems.
Find a sequence of points on a single rhumb line.
static T AngNormalize2(T x)