diff options
| author | Jacob Palecki <[email protected]> | 2020-07-31 12:20:11 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-07-31 12:20:11 -0700 |
| commit | 6537db04f7e717eda2f21e007cdba7e13b7f559e (patch) | |
| tree | efb65bf3f305f376ea75f4f687b08bf8998c020f /common/accel-logarithmic.hpp | |
| parent | Add class for storing settings from file (diff) | |
| parent | Merge pull request #6 from a1xd/st-refactor (diff) | |
| download | rawaccel-6537db04f7e717eda2f21e007cdba7e13b7f559e.tar.xz rawaccel-6537db04f7e717eda2f21e007cdba7e13b7f559e.zip | |
Show no settings for off, remove unused class for PR
Diffstat (limited to 'common/accel-logarithmic.hpp')
| -rw-r--r-- | common/accel-logarithmic.hpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/common/accel-logarithmic.hpp b/common/accel-logarithmic.hpp new file mode 100644 index 0000000..928eda9 --- /dev/null +++ b/common/accel-logarithmic.hpp @@ -0,0 +1,20 @@ +#pragma once + +#include <math.h> + +#include "accel-base.hpp" + +namespace rawaccel { + + /// <summary> Struct to hold logarithmic acceleration implementation. </summary> + struct accel_logarithmic : accel_base { + + using accel_base::accel_base; + + inline double accelerate(double speed) const { + //f(x) = log(m*x+1) + return log(speed_coeff * speed + 1); + } + }; + +} |