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_mod_ster.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_mod_ster.c')
| -rw-r--r-- | src/PJ_mod_ster.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/PJ_mod_ster.c b/src/PJ_mod_ster.c index 4c217141..d7f68790 100644 --- a/src/PJ_mod_ster.c +++ b/src/PJ_mod_ster.c @@ -26,8 +26,8 @@ static XY e_forward (LP lp, PJ *P) { /* Ellipsoidal, forward */ sinlon = sin(lp.lam); coslon = cos(lp.lam); esphi = P->e * sin(lp.phi); - chi = 2. * atan(tan((HALFPI + lp.phi) * .5) * - pow((1. - esphi) / (1. + esphi), P->e * .5)) - HALFPI; + chi = 2. * atan(tan((M_HALFPI + lp.phi) * .5) * + pow((1. - esphi) / (1. + esphi), P->e * .5)) - M_HALFPI; schi = sin(chi); cchi = cos(chi); s = 2. / (1. + Q->schio * schi + Q->cchio * cchi * coslon); @@ -76,8 +76,8 @@ static LP e_inverse (XY xy, PJ *P) { /* Ellipsoidal, inverse */ phi = chi; for (nn = 20; nn ;--nn) { esphi = P->e * sin(phi); - dphi = 2. * atan(tan((HALFPI + chi) * .5) * - pow((1. + esphi) / (1. - esphi), P->e * .5)) - HALFPI - phi; + dphi = 2. * atan(tan((M_HALFPI + chi) * .5) * + pow((1. + esphi) / (1. - esphi), P->e * .5)) - M_HALFPI - phi; phi += dphi; if (fabs(dphi) <= EPSLN) break; @@ -114,8 +114,8 @@ static PJ *setup(PJ *P) { /* general initialization */ if (P->es) { esphi = P->e * sin(P->phi0); - chio = 2. * atan(tan((HALFPI + P->phi0) * .5) * - pow((1. - esphi) / (1. + esphi), P->e * .5)) - HALFPI; + chio = 2. * atan(tan((M_HALFPI + P->phi0) * .5) * + pow((1. - esphi) / (1. + esphi), P->e * .5)) - M_HALFPI; } else chio = P->phi0; Q->schio = sin(chio); |
