mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 00:05:28 +03:00
Merge branch 'DzikuVx-inav-rates-in-dps'
This commit is contained in:
commit
cc8871dd4c
15 changed files with 128 additions and 104 deletions
|
@ -187,6 +187,12 @@ 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 a = (destMax - destMin) * (x - srcMin);
|
||||
float b = srcMax - srcMin;
|
||||
return ((a / b) - (destMax - destMin)) + destMax;
|
||||
}
|
||||
|
||||
// Normalize a vector
|
||||
void normalizeV(struct fp_vector *src, struct fp_vector *dest)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue