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_phi2.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_phi2.c')
| -rw-r--r-- | src/pj_phi2.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/pj_phi2.c b/src/pj_phi2.c index 5c81da48..60b36ec4 100644 --- a/src/pj_phi2.c +++ b/src/pj_phi2.c @@ -1,7 +1,6 @@ /* determine latitude angle phi-2 */ #include <projects.h> -#define HALFPI 1.5707963267948966 #define TOL 1.0e-10 #define N_ITER 15 @@ -11,11 +10,11 @@ pj_phi2(projCtx ctx, double ts, double e) { int i; eccnth = .5 * e; - Phi = HALFPI - 2. * atan (ts); + Phi = M_HALFPI - 2. * atan (ts); i = N_ITER; do { con = e * sin (Phi); - dphi = HALFPI - 2. * atan (ts * pow((1. - con) / + dphi = M_HALFPI - 2. * atan (ts * pow((1. - con) / (1. + con), eccnth)) - Phi; Phi += dphi; } while ( fabs(dphi) > TOL && --i); |
