Lua distance

a guest May 22nd, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function distance(from, to)
  2.   x = from[1] - to[1]
  3.   y = from[2] - to[2]
  4.   z = from[3] - to[3]
  5.   return math.floor(math.sqrt(x^2 + y^2 + z^2))
  6. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand