-from math import sqrt
-
-
class Coordinates:
- """Represents a set of GPS coordinates (latitude/longitude)."""
+ """Represents a set of GPS coordinates (longitude/latitude)."""
- def __init__(self):
- self.latitude = 0
- self.longitude = 0
-
-
-
-def CalculateDistance(p1, p2):
- """
- Calculate the distance between two Coordinates, p1 and p2.
- """
- delta_x = p2.longitude - p1.longitude
- delta_y = p2.latitude - p1.latitude
- euclidean_distance = sqrt(delta_x**2 + delta_y**2)
-
- return euclidean_distance
+ def __init__(self, x=0, y=0):
+ self.longitude = x
+ self.latitude = y