X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FGPS.py;h=59f8d5b3c2092ba3df2b16cce8c66c449f0526d9;hb=HEAD;hp=bc2e20be64b5e04e62ea836369aa73ae601de4fe;hpb=84d512e317cac78d67bec5c64fcf761d3f5e0689;p=dead%2Fcensus-tools.git diff --git a/src/GPS.py b/src/GPS.py index bc2e20b..59f8d5b 100644 --- a/src/GPS.py +++ b/src/GPS.py @@ -1,21 +1,6 @@ -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