From 3043b2f7fcf4471983c8d4472b17ccf9df1710c8 Mon Sep 17 00:00:00 2001 From: Micah Cochran Date: Sat, 28 May 2016 11:26:35 -0500 Subject: 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). --- src/PJ_hatano.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/PJ_hatano.c') diff --git a/src/PJ_hatano.c b/src/PJ_hatano.c index ca97849b..34c70c0f 100644 --- a/src/PJ_hatano.c +++ b/src/PJ_hatano.c @@ -45,7 +45,7 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */ if (fabs(th) > ONETOL) { I_ERROR; } else { - th = th > 0. ? HALFPI : - HALFPI; + th = th > 0. ? M_HALFPI : - M_HALFPI; } } else { th = asin(th); @@ -58,7 +58,7 @@ static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */ if (fabs(lp.phi) > ONETOL) { I_ERROR; } else { - lp.phi = lp.phi > 0. ? HALFPI : - HALFPI; + lp.phi = lp.phi > 0. ? M_HALFPI : - M_HALFPI; } } else { lp.phi = asin(lp.phi); -- cgit v1.2.3