summaryrefslogtreecommitdiff
path: root/dashboard_website
diff options
context:
space:
mode:
Diffstat (limited to 'dashboard_website')
-rw-r--r--dashboard_website/datastructs.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/dashboard_website/datastructs.py b/dashboard_website/datastructs.py
index b6b67f2..e5346dc 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(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)
+ a = math.sin(lat_d/2) * math.sin(lat_d/2) + math.cos(math.radians(lat1)) * math.cos(math.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
@@ -86,7 +86,7 @@ class Bike(Point):
self.cluster[0].visit()
self.cluster.pop(0)
self.updateTarget()
- while len(self.cluster) > 0 and cluster[0].status == "VISITED":
+ while len(self.cluster) > 0 and self.cluster[0].status == "VISITED":
self.cluster.pop(0) # skip next node if it has been somehow visited
self.updateTarget()