diff options
| author | a1xd <[email protected]> | 2021-07-05 23:33:41 -0400 |
|---|---|---|
| committer | a1xd <[email protected]> | 2021-07-05 23:33:41 -0400 |
| commit | 31efc792f5895d7ef3533390875de3c480add996 (patch) | |
| tree | 8db5b16a88f50448cb525ba8ae56801985294f63 /common/accel-naturalgain.hpp | |
| parent | Merge pull request #87 from matthewstrasiotto/streamer_mode (diff) | |
| parent | Handle power\exponent correctly in GUI (diff) | |
| download | rawaccel-31efc792f5895d7ef3533390875de3c480add996.tar.xz rawaccel-31efc792f5895d7ef3533390875de3c480add996.zip | |
merge lut2
Diffstat (limited to 'common/accel-naturalgain.hpp')
| -rw-r--r-- | common/accel-naturalgain.hpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/common/accel-naturalgain.hpp b/common/accel-naturalgain.hpp deleted file mode 100644 index cdfd1fa..0000000 --- a/common/accel-naturalgain.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#include <math.h> - -#include "accel-natural.hpp" - -namespace rawaccel { - - /// <summary> Struct to hold "natural" (vanishing difference) gain implementation. </summary> - struct naturalgain_impl : natural_impl { - - using natural_impl::natural_impl; - - inline double operator()(double speed) const { - // f(x) = k((e^(-mx)-1)/mx + 1) - double base_speed = speed + offset; - double scaled_speed = rate * speed; - return limit * (((exp(-scaled_speed) - 1) / (base_speed * rate) ) + 1 - offset / base_speed); - } - - inline double legacy_offset(double speed) const { - double scaled_speed = rate * speed; - return limit * (((exp(-scaled_speed) - 1) / scaled_speed) + 1); - } - }; - - using accel_naturalgain = additive_accel<naturalgain_impl>; -} |