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:
parent
30bdeae47d
commit
cf73ab9a39
7 changed files with 21 additions and 16 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue