diff options
Diffstat (limited to 'examples/python/route_guide/route_guide_server.py')
-rw-r--r-- | examples/python/route_guide/route_guide_server.py | 1 |
1 files changed, 1 insertions, 0 deletions
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))) |