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_tmerc.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_tmerc.c')
| -rw-r--r-- | src/PJ_tmerc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/PJ_tmerc.c b/src/PJ_tmerc.c index 35203261..ab77f4d7 100644 --- a/src/PJ_tmerc.c +++ b/src/PJ_tmerc.c @@ -33,7 +33,7 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */ * * http://trac.osgeo.org/proj/ticket/5 */ - if( lp.lam < -HALFPI || lp.lam > HALFPI ) { + if( lp.lam < -M_HALFPI || lp.lam > M_HALFPI ) { xy.x = HUGE_VAL; xy.y = HUGE_VAL; pj_ctx_set_errno( P->ctx, -14 ); @@ -74,7 +74,7 @@ static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */ * * http://trac.osgeo.org/proj/ticket/5 */ - if( lp.lam < -HALFPI || lp.lam > HALFPI ) { + if( lp.lam < -M_HALFPI || lp.lam > M_HALFPI ) { xy.x = HUGE_VAL; xy.y = HUGE_VAL; pj_ctx_set_errno( P->ctx, -14 ); @@ -110,8 +110,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */ double n, con, cosphi, d, ds, sinphi, t; lp.phi = pj_inv_mlfn(P->ctx, Q->ml0 + xy.y / P->k0, P->es, Q->en); - if (fabs(lp.phi) >= HALFPI) { - lp.phi = xy.y < 0. ? -HALFPI : HALFPI; + if (fabs(lp.phi) >= M_HALFPI) { + lp.phi = xy.y < 0. ? -M_HALFPI : M_HALFPI; lp.lam = 0.; } else { sinphi = sin(lp.phi); |
