Plane: Use sq() rather than powf() in soaring.cpp.

This commit is contained in:
Samuel Tabor 2020-08-04 10:14:18 +01:00 committed by Peter Barker
parent b2d63c5049
commit aa776b06a4

View File

@ -74,7 +74,7 @@ void Plane::update_soaring() {
// Check distance to home against MAX_RADIUS.
if (g2.soaring_controller.max_radius >= 0 &&
powf(position.x,2)+powf(position.y,2) > powf(g2.soaring_controller.max_radius,2) &&
sq(position.x)+sq(position.y) > sq(g2.soaring_controller.max_radius) &&
previous_mode->mode_number()!=Mode::Number::AUTO) {
// Some other loiter status, and outside of maximum soaring radius, and previous mode wasn't AUTO
gcs().send_text(MAV_SEVERITY_INFO, "Soaring: Outside SOAR_MAX_RADIUS, RTL");