diff options
| author | Jacob Palecki <[email protected]> | 2020-07-29 15:51:53 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-07-29 15:51:53 -0700 |
| commit | 0a91af55f79d9a9d5bda600e8eee7e17c65bd0b6 (patch) | |
| tree | 642659b6ed96b00bc4e9bf6d3152978889ea0079 /common/accel_linear.cpp | |
| parent | add sum types (diff) | |
| parent | Use modifier object in wrapper (diff) | |
| download | rawaccel-0a91af55f79d9a9d5bda600e8eee7e17c65bd0b6.tar.xz rawaccel-0a91af55f79d9a9d5bda600e8eee7e17c65bd0b6.zip | |
Merge remote-tracking branch 'downstream/Inheritance' into st-refactor
Diffstat (limited to 'common/accel_linear.cpp')
| -rw-r--r-- | common/accel_linear.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/common/accel_linear.cpp b/common/accel_linear.cpp new file mode 100644 index 0000000..307e33e --- /dev/null +++ b/common/accel_linear.cpp @@ -0,0 +1,21 @@ +#pragma once + +#define _USE_MATH_DEFINES +#include <math.h> + +#include "accel_types.hpp" + +namespace rawaccel { + inline accel_linear::accel_linear(accel_args args) + : accel_implentation(args) {} + + inline double accel_linear::accelerate(double speed) { + //f(x) = mx + return curve_constant_one * speed; + } + + inline void accel_linear::verify(accel_args args) { + accel_implentation::verify(args); + if (args.lim_exp <= 1) error("limit must be greater than 1"); + } +} |