Last active
January 7, 2023 15:54
-
-
Save miguelmota/d9005d0a8b2a1bf59695 to your computer and use it in GitHub Desktop.
Slope angle in JavaScript
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 getSlopeAngle(s1,s2) { | |
return Math.atan((s2[1] - s1[1]) / (s2[0] - s1[0])) * 180/Math.PI; | |
} | |
console.log(getSlopeAngle([0,0],[2,3]); // 56.309932474020215 |
m
how do i make it a script for chromebook it wont let me download anymore
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice 👍