-
-
Save xcoderzach/eda0a34f1003c116c2ac to your computer and use it in GitHub Desktop.
like acos, except returns degrees, a domain of -Infinity to Infinity, and a range of 0 to 360
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 f(x) { | |
x = ((((x + 2) % 4) + 4) % 4) - 2 | |
if(x > 1) return 360 - Math.acos(2 - x) * (180/Math.PI) | |
if(x < -1) return 360 - Math.acos(-2 - x) * (180/Math.PI) | |
return Math.acos(x) * (180/Math.PI) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment