Advertisement
Guest User

Lua distance

a guest
May 22nd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.15 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement