From ac0f7ce992aec2a0bca806ba807946d654a6b7d6 Mon Sep 17 00:00:00 2001 From: sakisdog Date: Sat, 17 Apr 2021 20:44:54 +0300 Subject: [PATCH] Update the mean earth radius number Based on http://en.wikipedia.org/wiki/Earth_radius and some Google Maps distance calculations i think this change produces more accurate results. --- src/TinyGPS++.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TinyGPS++.cpp b/src/TinyGPS++.cpp index e1ec777..fe451c7 100644 --- a/src/TinyGPS++.cpp +++ b/src/TinyGPS++.cpp @@ -304,7 +304,7 @@ double TinyGPSPlus::distanceBetween(double lat1, double long1, double lat2, doub delta = sqrt(delta); double denom = (slat1 * slat2) + (clat1 * clat2 * cdlong); delta = atan2(delta, denom); - return delta * 6372795; + return delta * 6371009; } double TinyGPSPlus::courseTo(double lat1, double long1, double lat2, double long2)