aboutsummaryrefslogtreecommitdiff
path: root/src/PJ_laea.c
diff options
context:
space:
mode:
authorMicah Cochran <micahcochran@users.noreply.github.com>2016-05-28 11:26:35 -0500
committerMicah Cochran <micahcochran@users.noreply.github.com>2016-05-28 11:26:35 -0500
commit3043b2f7fcf4471983c8d4472b17ccf9df1710c8 (patch)
tree94e63e8367dad31a6f0fe1703050d0ad79340785 /src/PJ_laea.c
parenta112ea3172e89230fa307567be3d70e286b1eeb5 (diff)
downloadPROJ-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_laea.c')
-rw-r--r--src/PJ_laea.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/PJ_laea.c b/src/PJ_laea.c
index 8393ebd0..f1cc9c7f 100644
--- a/src/PJ_laea.c
+++ b/src/PJ_laea.c
@@ -47,11 +47,11 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */
b = 1. + cosb * coslam;
break;
case N_POLE:
- b = HALFPI + lp.phi;
+ b = M_HALFPI + lp.phi;
q = Q->qp - q;
break;
case S_POLE:
- b = lp.phi - HALFPI;
+ b = lp.phi - M_HALFPI;
q = Q->qp + q;
break;
}
@@ -108,7 +108,7 @@ oblcon:
coslam = -coslam;
case S_POLE:
if (fabs(lp.phi + P->phi0) < EPS10) F_ERROR;
- xy.y = FORTPI - lp.phi * .5;
+ xy.y = M_FORTPI - lp.phi * .5;
xy.y = 2. * (Q->mode == S_POLE ? cos(xy.y) : sin(xy.y));
xy.x = xy.y * sin(lp.lam);
xy.y *= coslam;
@@ -192,10 +192,10 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
break;
case N_POLE:
xy.y = -xy.y;
- lp.phi = HALFPI - lp.phi;
+ lp.phi = M_HALFPI - lp.phi;
break;
case S_POLE:
- lp.phi -= HALFPI;
+ lp.phi -= M_HALFPI;
break;
}
lp.lam = (xy.y == 0. && (Q->mode == EQUIT || Q->mode == OBLIQ)) ?
@@ -229,7 +229,7 @@ PJ *PROJECTION(laea) {
P->opaque = Q;
t = fabs(P->phi0);
- if (fabs(t - HALFPI) < EPS10)
+ if (fabs(t - M_HALFPI) < EPS10)
Q->mode = P->phi0 < 0. ? S_POLE : N_POLE;
else if (fabs(t) < EPS10)
Q->mode = EQUIT;