summaryrefslogtreecommitdiff
path: root/common/accel-natural.hpp
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2021-04-07 23:38:47 -0700
committerJacob Palecki <[email protected]>2021-04-07 23:38:47 -0700
commite1b5ff67764384ab067cee7983cbaaf9b5df39ad (patch)
tree39ffa4a79bc6b019443521f10203f787c4b98698 /common/accel-natural.hpp
parentremove const from uneeded class (diff)
parentoptimize a bit/refactor modify (diff)
downloadrawaccel-e1b5ff67764384ab067cee7983cbaaf9b5df39ad.tar.xz
rawaccel-e1b5ff67764384ab067cee7983cbaaf9b5df39ad.zip
Merge remote-tracking branch 'upstream/dyn-lut-b' into lut2
Diffstat (limited to 'common/accel-natural.hpp')
-rw-r--r--common/accel-natural.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/accel-natural.hpp b/common/accel-natural.hpp
index 28e17c2..8d25351 100644
--- a/common/accel-natural.hpp
+++ b/common/accel-natural.hpp
@@ -26,8 +26,8 @@ namespace rawaccel {
{
if (x <= offset) return 1;
- double offset_x = x - offset;
- double decay = exp(-accel * offset_x);
+ double offset_x = offset - x;
+ double decay = exp(accel * offset_x);
return limit * (1 - (decay * offset_x + offset) / x) + 1;
}
@@ -41,8 +41,8 @@ namespace rawaccel {
{
if (x <= offset) return 1;
- double offset_x = x - offset;
- double decay = exp(-accel * offset_x);
+ double offset_x = offset - x;
+ double decay = exp(accel * offset_x);
double output = limit * (offset_x + decay / accel) + constant;
return output / x + 1;
}