The brackets are misplaced in Pythagoras' theorem in distance_to_coords:
The function distance_to_coords says
def distance_to_coords(self, lat_a, lon_a):
self.distance = (abs(self.lat - lat_a) ** 2) + (abs(self.lon - lon_a) ** 2) ** .5
but of course should be
def distance_to_coords(self, lat_a, lon_a):
self.distance = ((self.lat - lat_a) ** 2 + (self.lon - lon_a) ** 2) ** .5
Currently it's working out "a^2 + √b^2" instead of "√(a^2 + b^2)"
(I've also removed the abs commands which are of course not needed)
The brackets are misplaced in Pythagoras' theorem in
distance_to_coords:The function
distance_to_coordssaysbut of course should be
Currently it's working out "a^2 + √b^2" instead of "√(a^2 + b^2)"
(I've also removed the
abscommands which are of course not needed)