Created
December 5, 2023 10:48
-
-
Save neysidev/61d4e52ca9c52734f57d5d7dae242a1a 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
| function calculateAngle(point1, point2) { | |
| const angleInRadians = Math.atan2(point2.y - point1.y, point2.x - point1.x); | |
| const angleInDegrees = (angleInRadians * 180) / Math.PI; | |
| return angleInDegrees; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment