summaryrefslogtreecommitdiff
path: root/dashboard_website/datastructs.py
diff options
context:
space:
mode:
Diffstat (limited to 'dashboard_website/datastructs.py')
-rw-r--r--dashboard_website/datastructs.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/dashboard_website/datastructs.py b/dashboard_website/datastructs.py
index 24625d0..b6b67f2 100644
--- a/dashboard_website/datastructs.py
+++ b/dashboard_website/datastructs.py
@@ -34,7 +34,7 @@ class Point:
R = 3958.8 # Radius of the earth
lat_d = math.radians(lat2-lat1);
lon_d = math.radians(lon2-lon1);
- a = math.sin(dLat/2) * math.sin(dLat/2) + math.cos(radians(lat1)) * math.cos(radians(lat2)) * math.sin(dLon/2) * math.sin(dLon/2)
+ a = math.sin(lat_d/2) * math.sin(lat_d/2) + math.cos(radians(lat1)) * math.cos(radians(lat2)) * math.sin(lon_d/2) * math.sin(lon_d/2)
c = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a));
d = R * c; # Distance in mi
return d