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/nad2bin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nad2bin.c') diff --git a/src/nad2bin.c b/src/nad2bin.c index 2bbe2f4c..59ec1658 100644 --- a/src/nad2bin.c +++ b/src/nad2bin.c @@ -350,8 +350,8 @@ int main(int argc, char **argv) { + (ct.lim.lam - i - 1); /* convert radians to seconds */ - row_buf[i*4+0] = cvs->phi * (3600.0 / (PI/180.0)); - row_buf[i*4+1] = cvs->lam * (3600.0 / (PI/180.0)); + row_buf[i*4+0] = cvs->phi * (3600.0 / (M_PI/180.0)); + row_buf[i*4+1] = cvs->lam * (3600.0 / (M_PI/180.0)); /* We leave the accuracy values as zero */ } -- cgit v1.2.3