From 939f7a093dadfa89ac1bbe43b0c9fded404c1ad5 Mon Sep 17 00:00:00 2001 From: Anson Bridges Date: Fri, 17 Nov 2023 17:18:21 -0500 Subject: committing serverside fixes --- dashboard_website/datastructs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dashboard_website/datastructs.py') 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() -- cgit v1.2.3