mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-14 10:13:13 +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 tau = 2 * math.pi
|
||||||
local _cos = math.cos
|
local half_pi = math.pi / 2
|
||||||
|
|
||||||
math.sin = function(x)
|
math.sin = function(x)
|
||||||
local sign = 1
|
local sign = 1
|
||||||
x = x % 360
|
x = (x / tau * 360) % 360
|
||||||
if x < 0 then
|
if x < 0 then
|
||||||
x = - x
|
x = - x
|
||||||
sign = - sign
|
sign = - sign
|
||||||
@ -16,5 +16,5 @@ math.sin = function(x)
|
|||||||
end
|
end
|
||||||
|
|
||||||
math.cos = function(x)
|
math.cos = function(x)
|
||||||
return math.sin(x + 90)
|
return math.sin(x + half_pi)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user