aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Butler <howard@hobu.co>2016-09-02 09:02:40 -0500
committerGitHub <noreply@github.com>2016-09-02 09:02:40 -0500
commit82d0797275be73a50e72016e532efaffdba71bf3 (patch)
treedf6da2843fd1e7b6fc42d03ae55fef904335aad0
parenta726188b2c7d629d5811f0dfb280c98f6a64f711 (diff)
parent46bfa242b7cfae5d0ac09d9c44086c4ef7d3ca87 (diff)
downloadPROJ-82d0797275be73a50e72016e532efaffdba71bf3.tar.gz
PROJ-82d0797275be73a50e72016e532efaffdba71bf3.zip
Merge pull request #408 from OSGeo/issue-406-performance-improvement-aitoff
apply patch for #406 to improve Aitoff performance in some situations
-rw-r--r--src/PJ_aitoff.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/PJ_aitoff.c b/src/PJ_aitoff.c
index 5cd717b1..ef6e7d71 100644
--- a/src/PJ_aitoff.c
+++ b/src/PJ_aitoff.c
@@ -121,8 +121,7 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
f1 -= xy.x; f2 -= xy.y;
dl = (f2 * f1p - f1 * f2p) / (dp = f1p * f2l - f2p * f1l);
dp = (f1 * f2l - f2 * f1l) / dp;
- while (dl > M_PI) dl -= M_PI; /* set to interval [-M_PI, M_PI] */
- while (dl < -M_PI) dl += M_PI; /* set to interval [-M_PI, M_PI] */
+ dl = fmod(dl, M_PI); /* set to interval [-M_PI, M_PI] */
lp.phi -= dp; lp.lam -= dl;
} while ((fabs(dp) > EPSILON || fabs(dl) > EPSILON) && (iter++ < MAXITER));
if (lp.phi > M_PI_2) lp.phi -= 2.*(lp.phi-M_PI_2); /* correct if symmetrical solution for Aitoff */