AP_Math: prevent negative longitude scaling

for crazy locations
This commit is contained in:
Andrew Tridgell 2014-08-07 09:30:02 +10:00
parent 7752196628
commit b92873cab1

View File

@ -44,6 +44,7 @@ float longitude_scale(const struct Location &loc)
return scale;
}
scale = cosf(loc.lat * 1.0e-7f * DEG_TO_RAD);
scale = constrain_float(scale, 0.01f, 1.0f);
last_lat = loc.lat;
return scale;
}