Advertisement
Bolodefchoco_LUAXML

[Math] math.dist

Dec 17th, 2016
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.35 KB | None | 0 0
  1. --Creator: Bolodefchoco
  2. --Made in: 17/12/2016
  3. --Last update: 17/12/2016
  4. --[[ Notes:
  5.     Does:
  6.         Retorna a distância entre dois pontos.
  7.     Args:
  8.         x1 --> Ponto 1 horizontal
  9.         y1 --> Ponto 1 vertical
  10.         x2 --> Ponto 2 horizontal
  11.         y2 --> Ponto 2 vertical
  12. ]]--
  13.  
  14. math.dist = function(x1,y1,x2,y2)
  15.     return (math.abs(x1-x2)^2 + math.abs(y1-y2)^2)^.5
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement