Skip to content

Instantly share code, notes, and snippets.

@bmoore
Last active November 13, 2015 14:22
Show Gist options
  • Save bmoore/5e9e94be41eb4d9392c3 to your computer and use it in GitHub Desktop.
Save bmoore/5e9e94be41eb4d9392c3 to your computer and use it in GitHub Desktop.
# This tests whether the first point is east or west of the boundary
if (boundary[1] < point1[1]):
if (bearing < 30 and bearing > 230):
direction = 'Upstream'
else:
direction = 'Downstream'
else:
if (bearing < 270 and bearing > 120):
direction = 'Upstream'
else:
direction = 'Downstream'
if (boundary[1] < point1[1] and boundary[1] > point2[1]):
direction = 'Upstream'
if (boundary[1] > point1[1] and boundary[1] < point2[1]):
direction = 'Downstream'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment