feat(lib): add distance function
This commit is contained in:
parent
324cb2d6d8
commit
aa27d9fd36
@ -12,6 +12,10 @@ function get_player(name)
|
|||||||
end)[1]
|
end)[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function distance(p1, p2)
|
||||||
|
return math.sqrt((p2.x - p1.x) ^ 2 + (p2.y - p1.y) ^ 2 + (p2.z - p1.z) ^ 2)
|
||||||
|
end
|
||||||
|
|
||||||
function dump(object)
|
function dump(object)
|
||||||
if type(object) == "table" then
|
if type(object) == "table" then
|
||||||
local string = "{ "
|
local string = "{ "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user