summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dashboard_website/datastructs.py2
-rw-r--r--dashboard_website/db.py1
2 files changed, 2 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
diff --git a/dashboard_website/db.py b/dashboard_website/db.py
index d4b0186..6a638e7 100644
--- a/dashboard_website/db.py
+++ b/dashboard_website/db.py
@@ -171,6 +171,7 @@ def visitClueTeam(team_name, clue_name):
for bike in bikes:
if bike.name == team_name:
b = bike
+ break
else:
return 4 # team not found
c = None