Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. a = (5,6)
  2. b = (3,2)
  3.  
  4. if (a[0] > 0 & b[0] > 0) | (a[0] < 0 & b[0] < 0):
  5.     #both in same half
  6.     if a[0] > 0:
  7.         if a[1] > b[1]:
  8.             return 'clockwise'
  9.         else:
  10.             return 'anticlockwise'
  11.     else:
  12.         if a[1] < b[1]:
  13.             return 'clockwise'
  14.         else:
  15.             return 'anticlockwise'
  16.  
  17. elif a[0] == b[0]:
  18.     #both at same height, need to check y coordinates
  19. else:
  20.     #in opposite halves
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement