from math import * class Coordinate: def __init__(self, deg_latitude, deg_longitude): self.latitude = radians(deg_latitude) self.longitude = radians(deg_longitude) def distance(self, other): dlat = self.latitude - other.latitude dlon = self.longitude - other.longitude Hav = sin(dlat / 2)**2 + cos(self.latitude) * cos(other.latitude) * sin(dlon / 2)**2 return 6373 * 2 * atan2(sqrt(Hav), sqrt(1 - Hav)) zurich = Coordinate(47.36667, 8.55) brisbane = Coordinate(-27.46794, 153.02809) print("Zürich nach Brisbane:", int(zurich.distance(brisbane))) print("Brisbane nach Zürich:", int(brisbane.distance(zurich)))