2021-07-09 21:50:51 +02:00
|
|
|
|
|
|
|
#include "MathUtils.h"
|
|
|
|
#include <Arduino.h>
|
|
|
|
bool equalish(double x, double y)
|
|
|
|
{
|
|
|
|
return (abs(x - y) < 0.5);
|
2022-02-12 05:26:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
double mapf(double x, double in_min, double in_max, double out_min, double out_max)
|
|
|
|
{
|
|
|
|
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
|
|
|
}
|