1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 17:25:20 +03:00

Use macros for power with integer exponents

This commit is contained in:
Mathias Rasmussen 2021-12-14 11:53:09 +01:00
parent adcc36888b
commit 1b95e3c20f
5 changed files with 6 additions and 5 deletions

View file

@ -1511,7 +1511,7 @@ static void GPS_calculateDistanceFlownVerticalSpeed(bool initialize)
int32_t dir;
GPS_distance_cm_bearing(&gpsSol.llh.lat, &gpsSol.llh.lon, &lastCoord[GPS_LATITUDE], &lastCoord[GPS_LONGITUDE], &dist, &dir);
if (gpsConfig()->gps_use_3d_speed) {
dist = sqrtf(powf(gpsSol.llh.altCm - lastAlt, 2.0f) + powf(dist, 2.0f));
dist = sqrtf(sq(gpsSol.llh.altCm - lastAlt) + sq(dist));
}
GPS_distanceFlownInCm += dist;
}