aboutsummaryrefslogtreecommitdiff
path: root/src/PJ_ortho.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_ortho.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_ortho.c')
-rw-r--r--src/PJ_ortho.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/PJ_ortho.c b/src/PJ_ortho.c
index 14aeacc3..783777c0 100644
--- a/src/PJ_ortho.c
+++ b/src/PJ_ortho.c
@@ -36,7 +36,7 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */
case N_POLE:
coslam = - coslam;
case S_POLE:
- if (fabs(lp.phi - P->phi0) - EPS10 > HALFPI) F_ERROR;
+ if (fabs(lp.phi - P->phi0) - EPS10 > M_HALFPI) F_ERROR;
xy.y = cosphi * coslam;
break;
}
@@ -78,13 +78,13 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */
xy.x *= sinc * Q->cosph0;
sinchk:
if (fabs(lp.phi) >= 1.)
- lp.phi = lp.phi < 0. ? -HALFPI : HALFPI;
+ lp.phi = lp.phi < 0. ? -M_HALFPI : M_HALFPI;
else
lp.phi = asin(lp.phi);
break;
}
lp.lam = (xy.y == 0. && (Q->mode == OBLIQ || Q->mode == EQUIT))
- ? (xy.x == 0. ? 0. : xy.x < 0. ? -HALFPI : HALFPI)
+ ? (xy.x == 0. ? 0. : xy.x < 0. ? -M_HALFPI : M_HALFPI)
: atan2(xy.x, xy.y);
}
return lp;
@@ -113,7 +113,7 @@ PJ *PROJECTION(ortho) {
return freeup_new (P);
P->opaque = Q;
- if (fabs(fabs(P->phi0) - HALFPI) <= EPS10)
+ if (fabs(fabs(P->phi0) - M_HALFPI) <= EPS10)
Q->mode = P->phi0 < 0. ? S_POLE : N_POLE;
else if (fabs(P->phi0) > EPS10) {
Q->mode = OBLIQ;