diff options
| author | a1xd <[email protected]> | 2020-07-31 05:12:04 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-07-31 05:12:04 -0400 |
| commit | d5c012bcd5b7321671f9591a3e58d0b2c9507467 (patch) | |
| tree | fe64110f7678607947d19c5ba0b46ea2b15d69c4 /common/accel-logarithmic.hpp | |
| parent | Merge pull request #5 from JacobPalecki/WrapperAndGrapher (diff) | |
| parent | update grapher/wrapper for st-refactor (diff) | |
| download | rawaccel-d5c012bcd5b7321671f9591a3e58d0b2c9507467.tar.xz rawaccel-d5c012bcd5b7321671f9591a3e58d0b2c9507467.zip | |
Merge pull request #6 from a1xd/st-refactor
Refactor
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); + } + }; + +} |