Browse Source

Update calculate_headings.py

Move function explanation def
pull/55/head^2
Jack Sweeney 2 years ago committed by GitHub
parent
commit
ccc6855d07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      calculate_headings.py

2
calculate_headings.py

@ -17,10 +17,10 @@ def calculate_cardinal(d):
card = dirs[ix % len(dirs)]
return card
def calculate_deg_change(new_heading, original_heading):
"""Calculates change between two headings, returns negative degree if change is left, positive if right"""
if new_heading is None:
print("Track heading missing. No change")
return 0
"""Calculates change between two headings, returns negative degree if change is left, positive if right"""
normal = abs(original_heading-new_heading)
across_inital = 360 - abs(original_heading-new_heading)
if across_inital < normal:

Loading…
Cancel
Save