diff options
| author | ne_mene <[email protected]> | 2026-03-12 19:56:53 +0100 |
|---|---|---|
| committer | ne_mene <[email protected]> | 2026-03-12 19:56:53 +0100 |
| commit | 5179c0c029487ea0107c9f9a7d879cc44b51e924 (patch) | |
| tree | 9608bc7497490c74ad5e3711e5d122f3e2f070a7 /src/utils.lua | |
| parent | d4f1856d357de241320dd6cbf66972c74784c309 (diff) | |
| parent | 4828c80a92a40067d8f58922c38c4dbeeafc8403 (diff) | |
Merge remote-tracking branch 'refs/remotes/origin/main'
thanks
Diffstat (limited to 'src/utils.lua')
| -rw-r--r-- | src/utils.lua | 12 |
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 |
