diff --git a/libraries/AP_Math/vector3.cpp b/libraries/AP_Math/vector3.cpp index e13ab69a27..2bbf57790b 100644 --- a/libraries/AP_Math/vector3.cpp +++ b/libraries/AP_Math/vector3.cpp @@ -509,7 +509,7 @@ Vector3 Vector3::point_on_line_closest_to_other_point(const Vector3 &w1 const T line_vec_len = line_vec.length(); // protection against divide by zero if(::is_zero(line_vec_len)) { - return {0.0f, 0.0f, 0.0f}; + return w1; } const T scale = 1/line_vec_len;