1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-24 16:55:29 +03:00

Surface estimation tweaks

This commit is contained in:
Konstantin Sharlaimov (DigitalEntity) 2017-03-08 22:07:26 +10:00
parent 30bdeae47d
commit cf73ab9a39
7 changed files with 21 additions and 16 deletions

View file

@ -187,7 +187,7 @@ int scaleRange(int x, int srcMin, int srcMax, int destMin, int destMax) {
return ((a / b) - (destMax - destMin)) + destMax;
}
int scaleRangef(float x, float srcMin, float srcMax, float destMin, float destMax) {
float scaleRangef(float x, float srcMin, float srcMax, float destMin, float destMax) {
float a = (destMax - destMin) * (x - srcMin);
float b = srcMax - srcMin;
return ((a / b) - (destMax - destMin)) + destMax;