aboutsummaryrefslogtreecommitdiff
path: root/src/utils.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.lua')
-rw-r--r--src/utils.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/utils.lua b/src/utils.lua
index 29c3024..33ca7e8 100644
--- a/src/utils.lua
+++ b/src/utils.lua
@@ -18,6 +18,12 @@ function min(a, b)
return b
end
+function pop(tbl)
+ local last = tbl[#tbl]
+ tbl[#tbl] = nil
+ return last
+end
+
function normalize(x, y)
if x == 0 and y == 0 then
return 0, 0
@@ -38,11 +44,7 @@ function dist(x1, y1, x2, y2)
return (dx*dx + dy*dy)^0.5
end
-mathx = {}
-
-mathx.tau = math.pi * 2
-
-function mathx.sign(x)
+function sign(x)
if x == 0 then
return 0
end