functions.lua 376 B

123456789101112131415161718192021
  1. -- localize math functions
  2. local pi = math.pi
  3. local square = math.sqrt
  4. local sin = math.sin
  5. local cos = math.cos
  6. local abs = math.abs
  7. local min = math.min
  8. local max = math.max
  9. local atann = math.atan
  10. local random = math.random
  11. local floor = math.floor
  12. local atan = function(x)
  13. if not x or x ~= x then
  14. --error("atan bassed NaN")
  15. return 0
  16. else
  17. return atann(x)
  18. end
  19. end