mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-14 11:59:56 +03:00
Merge pull request #7746 from JulioCesarMatias/MathAddNewFunction
[maths.c] Add 2D and 3D Pythagorean functions
This commit is contained in:
commit
e24996e28b
16 changed files with 42 additions and 25 deletions
|
@ -550,7 +550,7 @@ static int logicConditionGetFlightOperandValue(int operand) {
|
|||
break;
|
||||
|
||||
case LOGIC_CONDITION_OPERAND_FLIGHT_3D_HOME_DISTANCE: //in m
|
||||
return constrain(fast_fsqrtf(sq(GPS_distanceToHome) + sq(getEstimatedActualPosition(Z)/100)), 0, INT16_MAX);
|
||||
return constrain(calc_length_pythagorean_2D(GPS_distanceToHome, getEstimatedActualPosition(Z) / 100.0f), 0, INT16_MAX);
|
||||
break;
|
||||
|
||||
case LOGIC_CONDITION_OPERAND_FLIGHT_CRSF_LQ:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue