Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //by Variouscacti
- //How To Use:
- //Name function "arccos" for compatibility with my other functions
- //Input a value to the stat "arccosInput" 1000000 times the intended input, where -1000000 <= input <= 1000000
- //Output will be in the stat "arccosOutput", where 0 <= output <= 180 (Calculation is in degrees)
- //Requires function "arcsin": https://pastebin.com/6mY8eZkY
- //Desmos graph: https://www.desmos.com/calculator/blkasabzfh
- //Enjoy!
- //check input
- if or (stat arccosInput < -1000000, stat arccosInput > 1000000) {
- chat "Error! Invalid arccos input!"
- exit
- } else {
- //plug into sin and run
- stat arcsinInput = %stat.player/arccosInput%
- function arcsin false
- stat arccosOutput = %stat.player/arcsinOutput%
- //convert to arccos
- stat arccosOutput *= -1
- stat arccosOutput += 90
- }
- //cleanup
- if () {
- stat arccosInput = 0
- stat arcsinOutput = 0
- }
Advertisement
Add Comment
Please, Sign In to add comment