exponentialFromLimits make small number const

This commit is contained in:
Dennis Mannhart 2018-11-29 13:04:28 +01:00 committed by Daniel Agar
parent be4900f61d
commit 55947d2782
1 changed files with 2 additions and 2 deletions

View File

@ -175,13 +175,13 @@ const T gradual(const T &value, const T &x_low, const T &x_high, const T &y_low,
template<typename T>
const T expontialFromLimits(const T &X_in, const T &Y_min, const T &Y_mid, const T &Y_max)
{
T SIGMA_NORM = (T)0.001;
const T delta = (T)0.001;
// constrain X_in to the range of 0 and 2
T X = math::constrain(X_in, (T)0, (T)2);
// If Y_mid is exactly in the middle, then just apply linear approach.
bool use_linear_approach = false;
if (((Y_max + Y_min) * (T)0.5) - Y_mid < SIGMA_NORM) {
if (((Y_max + Y_min) * (T)0.5) - Y_mid < delta) {
use_linear_approach = true;
}