mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-12 10:04:40 +02:00
made sin use rads instead of deg
This commit is contained in:
parent
7e0194996d
commit
b01cef726b
@ -1,9 +1,9 @@
|
||||
local _sin = math.sin
|
||||
local _cos = math.cos
|
||||
local tau = 2 * math.pi
|
||||
local half_pi = math.pi / 2
|
||||
|
||||
math.sin = function(x)
|
||||
local sign = 1
|
||||
x = x % 360
|
||||
x = (x / tau * 360) % 360
|
||||
if x < 0 then
|
||||
x = - x
|
||||
sign = - sign
|
||||
@ -16,5 +16,5 @@ math.sin = function(x)
|
||||
end
|
||||
|
||||
math.cos = function(x)
|
||||
return math.sin(x + 90)
|
||||
return math.sin(x + half_pi)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user