This commit is contained in:
Slatian 2023-12-28 21:36:04 -08:00 committed by GitHub
commit ceb42bb236
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,18 @@ local pi = math.pi
local pi2 = pi * 2
local sin = math.sin
local rad = math.rad
local random = math.random
-- fix for negative coordinates
local function random(a,b)
if b == nil then
return math.random(a)
elseif a < b then
return math.random(a,b)
else
return math.random(b,a)
end
end
local function diff(a, b) -- Get difference between 2 angles
return atan2(sin(b - a), cos(b - a))