triclops200

Angle

Nov 1st, 2012
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. def betweenTwoAngles(A,B,x):
  2.     #The semicircle moves from A to B
  3.     #The range for A, B and x are -math.pi to math.pi
  4.     tau = math.pi*2
  5.     if A < 0:
  6.         A += tau
  7.     if B < 0:
  8.         B += tau
  9.     if x < 0:
  10.         x += tau
  11.     B -= A
  12.     x -= A
  13.     A = 0
  14.     if x <= B and x > 0:
  15.         return True
  16.     return False
Advertisement
Add Comment
Please, Sign In to add comment