From 1e8e527c4a4066443946ebf3edb83c43cd60a6e0 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Wed, 21 Jun 2017 11:06:51 +0200 Subject: Correct calculation of meridian convergence for non-conformal projections. Fixes #526. --- src/pj_deriv.c | 16 ++++++++-------- src/pj_factors.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/pj_deriv.c b/src/pj_deriv.c index 6e9e3b82..1c969a9d 100644 --- a/src/pj_deriv.c +++ b/src/pj_deriv.c @@ -17,8 +17,8 @@ int pj_deriv(LP lp, double h, PJ *P, struct DERIVS *der) { der->x_l = t.x; der->y_p = t.y; - der->x_p = -t.x; - der->y_l = -t.y; + der->x_p = t.x; + der->y_l = t.y; lp.phi -= h; if (fabs(lp.phi) > M_HALFPI) return 1; @@ -29,8 +29,8 @@ int pj_deriv(LP lp, double h, PJ *P, struct DERIVS *der) { der->x_l += t.x; der->y_p -= t.y; - der->x_p += t.x; - der->y_l -= t.y; + der->x_p -= t.x; + der->y_l += t.y; lp.lam -= h; t = (*P->fwd)(lp, P); if (t.x == HUGE_VAL) @@ -38,8 +38,8 @@ int pj_deriv(LP lp, double h, PJ *P, struct DERIVS *der) { der->x_l -= t.x; der->y_p -= t.y; - der->x_p += t.x; - der->y_l += t.y; + der->x_p -= t.x; + der->y_l -= t.y; lp.phi += h; t = (*P->fwd)(lp, P); if (t.x == HUGE_VAL) @@ -47,8 +47,8 @@ int pj_deriv(LP lp, double h, PJ *P, struct DERIVS *der) { der->x_l -= t.x; der->y_p += t.y; - der->x_p -= t.x; - der->y_l += t.y; + der->x_p += t.x; + der->y_l -= t.y; der->x_l /= (h += h); der->y_p /= h; der->x_p /= h; diff --git a/src/pj_factors.c b/src/pj_factors.c index fb4a1dd4..6c1b4978 100644 --- a/src/pj_factors.c +++ b/src/pj_factors.c @@ -72,7 +72,7 @@ int pj_factors(LP lp, PJ *P, double h, struct FACTORS *fac) { /* convergence */ if (!(fac->code & IS_ANAL_CONV)) { - fac->conv = - atan2(fac->der.y_l, fac->der.x_l); + fac->conv = - atan2(fac->der.x_p, fac->der.y_p); if (fac->code & IS_ANAL_XL_YL) fac->code |= IS_ANAL_CONV; } -- cgit v1.2.3