diff options
| author | Jacob Palecki <[email protected]> | 2021-04-08 22:23:48 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2021-04-08 22:23:48 -0700 |
| commit | 0bf728ac4f0443cb1093d7eb3d2635bf068182b0 (patch) | |
| tree | 93fb9cc0c96cd1bb162b25a1adf825d389195802 /common/accel-natural.hpp | |
| parent | Progress in arbitrary (diff) | |
| parent | make it safe (diff) | |
| download | rawaccel-0bf728ac4f0443cb1093d7eb3d2635bf068182b0.tar.xz rawaccel-0bf728ac4f0443cb1093d7eb3d2635bf068182b0.zip | |
merge and improve
Diffstat (limited to 'common/accel-natural.hpp')
| -rw-r--r-- | common/accel-natural.hpp | 4 |
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; } |