This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
--- Original source code: https://github.com/m-lundberg/simple-pid/tree/master | |
--- Translated to lua: SpaceEye | |
--- | |
local function _clamp(value, limits) | |
limits = limits or {} | |
local lower, upper = limits[1], limits[2] | |
if value == nil then | |
return nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
--- Original creator of formulas: @sashafiesta on Discord | |
--- Original creator of python adaptation: @malexy on Discord | |
--- Optimized and translated python code to lua: SpaceEye. (https://gist.github.com/SuperSpaceEye/c33443213605d1bf35f81737c9058dc2) | |
--- Some lua optimizations: Autist69420 | |
--- | |
-- Simple micro-optimizations for better performance | |
local table_insert = table.insert | |
local rad, sin, cos, log, abs, min, pow = math.rad, math.sin, math.cos, math.log, math.abs, math.min, math.pow |