Created
March 25, 2019 13:50
-
-
Save ManivannanMurugavel/0109cb44f7a10cfb5525be254150f309 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 numpy as np | |
a = np.array([6,0]) | |
b = np.array([0,0]) | |
c = np.array([0,6]) | |
ba = a - b | |
bc = c - b | |
cosine_angle = np.dot(ba, bc) / (np.linalg.norm(ba) * np.linalg.norm(bc)) | |
angle = np.arccos(cosine_angle) | |
print np.degrees(angle) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment