Skip to content

Commit 25bfd14

Browse files
authored
adjust greatcircle conversion factors, kill gcgeodist cheat. (#1156)
* tweak greatcircle conversions. * modify arc-project test to use microdegrees instead of nanodegrees. * kill unused metric prefix conversion macros.
1 parent a462a07 commit 25bfd14

File tree

11 files changed

+46
-875
lines changed

11 files changed

+46
-875
lines changed

defs.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,6 @@ constexpr double MPH_TO_MPS(double a) { return a * kMPSPerMPH;}
115115
/* knots(nautical miles/hour) to meters/second */
116116
constexpr double KNOTS_TO_MPS(double a) {return a * kMPSPerKnot;}
117117

118-
#define MILLI_TO_MICRO(t) ((t) * 1000) /* Milliseconds to Microseconds */
119-
#define MICRO_TO_MILLI(t) ((t) / 1000) /* Microseconds to Milliseconds*/
120-
#define CENTI_TO_MICRO(t) ((t) * 10000) /* Centiseconds to Microseconds */
121-
#define MICRO_TO_CENTI(t) ((t) / 10000) /* Centiseconds to Microseconds */
122-
123118
constexpr int kDatumOSGB36 = 86; // GPS_Lookup_Datum_Index("OSGB36")
124119
constexpr int kDautmWGS84 = 118; // GPS_Lookup_Datum_Index("WGS 84")
125120

grtcirc.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ void linepart(double lat1, double lon1,
4545
double* reslat, double* reslon);
4646

4747
/* Degrees to radians */
48-
constexpr double DEG(double x) { return (x) * 180.0 / M_PI; }
48+
constexpr double kDegreesPerRadian = 180.0 / M_PI;
49+
constexpr double DEG(double x) { return x * kDegreesPerRadian; }
4950

5051
/* Radians to degrees */
51-
constexpr double RAD(double x) { return (x) * M_PI / 180.0; }
52+
constexpr double kRadiansPerDegree = 1.0 / kDegreesPerRadian;
53+
constexpr double RAD(double x) { return x * kRadiansPerDegree; }
5254

5355
#endif

reference/arc-project1.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
No,Latitude,Longitude,Name,Symbol
2+
1,28.356662,-16.497183,"wpt2","flag, red"
3+
2,28.357407,-16.501378,"wpt3","flag, green"

reference/arc-project1.gpx

Lines changed: 0 additions & 265 deletions
This file was deleted.

reference/arc-project2.csv

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
No,Latitude,Longitude,Name,Symbol
2+
1,28.358827,-16.501228,"wpt1","flag, green"
3+
2,28.354380,-16.495831,"wpt4","flag, green"
4+
3,28.353926,-16.496775,"wpt5","flag, green"
5+
4,28.358987,-16.499790,"wpt6","flag, green"

0 commit comments

Comments
 (0)