diff options
| author | a1xd <[email protected]> | 2020-09-26 20:07:06 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-09-26 20:07:06 -0400 |
| commit | 02de2ce503fad0b501893d040405922b23814dc9 (patch) | |
| tree | 14cf982742ce4fc52c742b0befd8b256aa0dce94 /common/accel-logarithm.hpp | |
| parent | Merge pull request #24 from JacobPalecki/GUI (diff) | |
| parent | Hide minimum time attribute (diff) | |
| download | rawaccel-02de2ce503fad0b501893d040405922b23814dc9.tar.xz rawaccel-02de2ce503fad0b501893d040405922b23814dc9.zip | |
Merge pull request #25 from JacobPalecki/GUI
Small fixes and touchups
Diffstat (limited to 'common/accel-logarithm.hpp')
| -rw-r--r-- | common/accel-logarithm.hpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/common/accel-logarithm.hpp b/common/accel-logarithm.hpp deleted file mode 100644 index 044d23c..0000000 --- a/common/accel-logarithm.hpp +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include <math.h> - -#include "accel-base.hpp" - -namespace rawaccel { - - /// <summary> Struct to hold sigmoid (s-shaped) gain implementation. </summary> - struct logarithm_impl { - double rate; - double offset; - double additive_const; - - logarithm_impl (const accel_args& args) : - rate(args.rate), offset (args.offset) { - additive_const = offset * rate; - } - - inline double operator()(double speed) const { - double scaled_speed = rate * speed + 1; - double base_speed = speed + offset; - - return (scaled_speed * log(scaled_speed) + additive_const ) / ( rate * base_speed) - 1; - } - - inline double legacy_offset(double speed) const { return operator()(speed); } - }; - - using accel_logarithm = additive_accel<logarithm_impl>; - -} |