Variouscacti

Inverse Cosine Function Hypixel Housing

Apr 22nd, 2023 (edited)
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | Gaming | 0 0
  1. //by Variouscacti
  2.  
  3. //How To Use:
  4. //Name function "arccos" for compatibility with my other functions
  5. //Input a value to the stat "arccosInput" 1000000 times the intended input, where -1000000 <= input <= 1000000
  6. //Output will be in the stat "arccosOutput", where 0 <= output <= 180 (Calculation is in degrees)
  7. //Requires function "arcsin": https://pastebin.com/6mY8eZkY
  8.  
  9. //Desmos graph: https://www.desmos.com/calculator/blkasabzfh
  10.  
  11. //Enjoy!
  12.  
  13. //check input
  14. if or (stat arccosInput < -1000000, stat arccosInput > 1000000) {
  15. chat "Error! Invalid arccos input!"
  16. exit
  17. } else {
  18.  
  19. //plug into sin and run
  20. stat arcsinInput = %stat.player/arccosInput%
  21. function arcsin false
  22. stat arccosOutput = %stat.player/arcsinOutput%
  23.  
  24. //convert to arccos
  25. stat arccosOutput *= -1
  26. stat arccosOutput += 90
  27. }
  28.  
  29. //cleanup
  30. if () {
  31. stat arccosInput = 0
  32. stat arcsinOutput = 0
  33. }
Advertisement
Add Comment
Please, Sign In to add comment