define member variables with capital letters

This commit is contained in:
Sven Czarnian
2021-10-13 12:52:29 +02:00
parent 9d69a60396
commit 1e043e2765
15 changed files with 229 additions and 223 deletions

View File

@@ -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