From 86b2155cf14a205951a41cc2ce8d574feedde03a Mon Sep 17 00:00:00 2001 From: Charles Karney Date: Thu, 13 Aug 2015 13:11:58 -0400 Subject: Fix the constants used for degree/radian conversions. In dmstor.c an inaccurate constant was used for pi/180. This meant that 90deg converted to radians and back to degrees gave a result which was larger than 90deg. The constant has been replaced by DEG_TO_RAD (defined in proj_api.h). In rtodms.c, the trailing digits in CONV were wrong; the constant has been truncated so that all the digits are corrent. --- src/dmstor.c | 2 +- src/rtodms.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dmstor.c b/src/dmstor.c index 62c06f3d..9665d5a9 100644 --- a/src/dmstor.c +++ b/src/dmstor.c @@ -11,7 +11,7 @@ static double proj_strtod(char *nptr, char **endptr); *sym = "NnEeSsWw"; static const double vm[] = { - .0174532925199433, + DEG_TO_RAD, .0002908882086657216, .0000048481368110953599 }; diff --git a/src/rtodms.c b/src/rtodms.c index abf6bc1c..591874a6 100644 --- a/src/rtodms.c +++ b/src/rtodms.c @@ -10,7 +10,7 @@ static double RES = 1000., RES60 = 60000., -CONV = 206264806.24709635515796003417; +CONV = 206264806.24709635516; static char format[50] = "%dd%d'%.3f\"%c"; static int -- cgit v1.2.3