Created
March 25, 2019 13:46
-
-
Save ManivannanMurugavel/96e02cfd8875f6b94ea48e4c2741df1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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