From a26aecc03b5c110ce0912f3340933a4ed87d5ec0 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 22 Mar 2018 11:54:28 +0100 Subject: reimplement distance calculation in routeguide --- examples/python/route_guide/route_guide_server.py | 1 + 1 file changed, 1 insertion(+) (limited to 'examples/python') diff --git a/examples/python/route_guide/route_guide_server.py b/examples/python/route_guide/route_guide_server.py index f10008fdec..1969fdd378 100644 --- a/examples/python/route_guide/route_guide_server.py +++ b/examples/python/route_guide/route_guide_server.py @@ -46,6 +46,7 @@ def get_distance(start, end): delta_lat_rad = math.radians(lat_2 - lat_1) delta_lon_rad = math.radians(lon_2 - lon_1) + # Formula is based on http://mathforum.org/library/drmath/view/51879.html a = (pow(math.sin(delta_lat_rad / 2), 2) + (math.cos(lat_rad_1) * math.cos(lat_rad_2) * pow( math.sin(delta_lon_rad / 2), 2))) -- cgit v1.2.3