Skip to content

Commit

Permalink
Renamed toazimuth.
Browse files Browse the repository at this point in the history
  • Loading branch information
alanwatsonforster committed Sep 23, 2023
1 parent c0cf637 commit 49decad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions airpower/aircraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __str__(self):
self._name,
aphexcode.fromxy(self._x, self._y),
self._altitude,
apazimuth.toazimuth(self._facing),
apazimuth.fromfacing(self._facing),
self._altitudecarry
)

Expand All @@ -61,7 +61,7 @@ def _position(self):
return "%2s %-9s %-3s %2d" % (
apmaps.fromxy(self._x, self._y),
aphexcode.fromxy(self._x, self._y),
apazimuth.toazimuth(self._facing),
apazimuth.fromfacing(self._facing),
self._altitude
)

Expand Down
2 changes: 1 addition & 1 deletion airpower/azimuth.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def tofacing(azimuth):
raise ValueError("use azimuth \"%s\" instead of \"%s\"" % (superseded[azimuth], azimuth))
return (_northfacing - azimuth) % 360

def toazimuth(facing):
def fromfacing(facing):
azimuth = (_northfacing - facing) % 360
if azimuth % 30 == 0:
named = ["N", "NNE", "ENE", "E", "ESE", "SSE", "S", "SSW", "WSW", "W", "WNW", "NNW"]
Expand Down

0 comments on commit 49decad

Please sign in to comment.