diff options
| author | Micah Cochran <micahcochran@users.noreply.github.com> | 2016-05-28 11:26:35 -0500 |
|---|---|---|
| committer | Micah Cochran <micahcochran@users.noreply.github.com> | 2016-05-28 11:26:35 -0500 |
| commit | 3043b2f7fcf4471983c8d4472b17ccf9df1710c8 (patch) | |
| tree | 94e63e8367dad31a6f0fe1703050d0ad79340785 /src/PJ_loxim.c | |
| parent | a112ea3172e89230fa307567be3d70e286b1eeb5 (diff) | |
| download | PROJ-3043b2f7fcf4471983c8d4472b17ccf9df1710c8.tar.gz PROJ-3043b2f7fcf4471983c8d4472b17ccf9df1710c8.zip | |
Change math constants, similar to PR #372. Use M_ namespace with the de facto standard M_PI and its ilk. Change names that are widely used in the project to be in the M_ namespace, so HALFPI becomes M_HALFPI. HALFPI is #defined as M_PI_2 (the defacto standard name). #defines _USE_MATH_DEFINES for MS Visual Studio (I didn't personally test this part, but Appveyor will not build otherwise).
Diffstat (limited to 'src/PJ_loxim.c')
| -rw-r--r-- | src/PJ_loxim.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/PJ_loxim.c b/src/PJ_loxim.c index 9ddfd51c..0ce81c2c 100644 --- a/src/PJ_loxim.c +++ b/src/PJ_loxim.c @@ -20,8 +20,8 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */ if (fabs(xy.y) < EPS) xy.x = lp.lam * Q->cosphi1; else { - xy.x = FORTPI + 0.5 * lp.phi; - if (fabs(xy.x) < EPS || fabs(fabs(xy.x) - HALFPI) < EPS) + xy.x = M_FORTPI + 0.5 * lp.phi; + if (fabs(xy.x) < EPS || fabs(fabs(xy.x) - M_HALFPI) < EPS) xy.x = 0.; else xy.x = lp.lam * xy.y / log( tan(xy.x) / Q->tanphi1 ); @@ -38,8 +38,8 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */ if (fabs(xy.y) < EPS) { lp.lam = xy.x / Q->cosphi1; } else { - lp.lam = FORTPI + 0.5 * lp.phi; - if (fabs(lp.lam) < EPS || fabs(fabs(lp.lam) - HALFPI) < EPS) + lp.lam = M_FORTPI + 0.5 * lp.phi; + if (fabs(lp.lam) < EPS || fabs(fabs(lp.lam) - M_HALFPI) < EPS) lp.lam = 0.; else lp.lam = xy.x * log( tan(lp.lam) / Q->tanphi1 ) / xy.y ; @@ -75,7 +75,7 @@ PJ *PROJECTION(loxim) { if (Q->cosphi1 < EPS) E_ERROR(-22); - Q->tanphi1 = tan(FORTPI + 0.5 * Q->phi1); + Q->tanphi1 = tan(M_FORTPI + 0.5 * Q->phi1); P->inv = s_inverse; P->fwd = s_forward; |
