define member variables with capital letters
This commit is contained in:
@@ -21,18 +21,18 @@ class Waypoint:
|
||||
return dd
|
||||
|
||||
def __init__(self, name : str, latitude : float, longitude : float):
|
||||
self.name = name
|
||||
self.coordinate = np.array([ latitude, longitude ])
|
||||
self.Name = name
|
||||
self.Coordinate = np.array([ latitude, longitude ])
|
||||
|
||||
def __str__(self):
|
||||
return 'Name: ' + self.name + ', Lat: ' + str(self.coordinate[0]) + ', Lon: ' + str(self.coordinate[1])
|
||||
return 'Name: ' + self.Name + ', Lat: ' + str(self.Coordinate[0]) + ', Lon: ' + str(self.Coordinate[1])
|
||||
|
||||
def haversine(self, other):
|
||||
geodesic = pyproj.Geod(ellps='WGS84')
|
||||
forward, backward, distance = geodesic.inv(self.coordinate[1], self.coordinate[0], other.coordinate[1], other.coordinate[0])
|
||||
forward, backward, distance = geodesic.inv(self.Coordinate[1], self.Coordinate[0], other.Coordinate[1], other.Coordinate[0])
|
||||
return distance / 1000.0
|
||||
|
||||
def bearing(self, other):
|
||||
geodesic = pyproj.Geod(ellps='WGS84')
|
||||
forward, backward, distance = geodesic.inv(self.coordinate[1], self.coordinate[0], other.coordinate[1], other.coordinate[0])
|
||||
forward, backward, distance = geodesic.inv(self.Coordinate[1], self.Coordinate[0], other.Coordinate[1], other.Coordinate[0])
|
||||
return forward
|
||||
|
||||
Reference in New Issue
Block a user