Skip to content

Instantly share code, notes, and snippets.

@ManivannanMurugavel
Created March 25, 2019 13:46
Show Gist options
  • Save ManivannanMurugavel/96e02cfd8875f6b94ea48e4c2741df1e to your computer and use it in GitHub Desktop.
Save ManivannanMurugavel/96e02cfd8875f6b94ea48e4c2741df1e to your computer and use it in GitHub Desktop.
import math
def getAngle(a, b, c):
ang = math.degrees(math.atan2(c[1]-b[1], c[0]-b[0]) - math.atan2(a[1]-b[1], a[0]-b[0]))
return ang + 360 if ang < 0 else ang
print(getAngle((5, 0), (0, 0), (0, 5)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment