Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active January 7, 2023 15:54
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miguelmota/d9005d0a8b2a1bf59695 to your computer and use it in GitHub Desktop.
Save miguelmota/d9005d0a8b2a1bf59695 to your computer and use it in GitHub Desktop.
Slope angle in JavaScript
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
@JeancarloFontalvo
Copy link

Nice 👍

@BeanosX
Copy link

BeanosX commented Nov 18, 2021

m

@imasuicidebomber
Copy link

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