From c55d1bfd01147fa014ac07d4b03ef3cad8427ae6 Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Thu, 8 Apr 2021 02:30:01 -0400 Subject: optimize a bit/refactor modify --- common/accel-natural.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'common/accel-natural.hpp') 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; } -- cgit v1.2.3