summaryrefslogtreecommitdiff
path: root/common/accel-natural.hpp
diff options
context:
space:
mode:
authorJacob Palecki <[email protected]>2021-04-08 22:23:48 -0700
committerJacob Palecki <[email protected]>2021-04-08 22:23:48 -0700
commit0bf728ac4f0443cb1093d7eb3d2635bf068182b0 (patch)
tree93fb9cc0c96cd1bb162b25a1adf825d389195802 /common/accel-natural.hpp
parentProgress in arbitrary (diff)
parentmake it safe (diff)
downloadrawaccel-0bf728ac4f0443cb1093d7eb3d2635bf068182b0.tar.xz
rawaccel-0bf728ac4f0443cb1093d7eb3d2635bf068182b0.zip
merge and improve
Diffstat (limited to 'common/accel-natural.hpp')
-rw-r--r--common/accel-natural.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/accel-natural.hpp b/common/accel-natural.hpp
index 8d25351..9f76d1a 100644
--- a/common/accel-natural.hpp
+++ b/common/accel-natural.hpp
@@ -28,7 +28,7 @@ namespace rawaccel {
double offset_x = offset - x;
double decay = exp(accel * offset_x);
- return limit * (1 - (decay * offset_x + offset) / x) + 1;
+ return limit * (1 - (offset - decay * offset_x) / x) + 1;
}
using natural_base::natural_base;
@@ -43,7 +43,7 @@ namespace rawaccel {
double offset_x = offset - x;
double decay = exp(accel * offset_x);
- double output = limit * (offset_x + decay / accel) + constant;
+ double output = limit * (decay / accel - offset_x) + constant;
return output / x + 1;
}