10 lines
379 B
Lua
10 lines
379 B
Lua
math_functions={}
|
|
--- Sine function with period and amplitude
|
|
--- @param x number Input value
|
|
--- @param period number Period of sine wave
|
|
--- @param amp number Peak amplitude of sine wave
|
|
function math_functions.wave(x, period, amp) return math.sin((2/period)*math.pi*(x%period))*amp end
|
|
function math_functions.lerp(a, b, t) return a + ((b - a) * t) end
|
|
|
|
return math_functions
|