AC_Circle: use fast_atan2 to calc bearing from center

This does not save much time because it's only called at initialisation
This commit is contained in:
Randy Mackay 2014-06-06 17:56:35 +09:00
parent f23e94707c
commit 915dad2da4
1 changed files with 1 additions and 1 deletions

View File

@ -248,7 +248,7 @@ void AC_Circle::init_start_angle(bool use_heading)
_angle = wrap_PI(_ahrs.yaw-PI); _angle = wrap_PI(_ahrs.yaw-PI);
} else { } else {
// get bearing from circle center to vehicle in radians // get bearing from circle center to vehicle in radians
float bearing_rad = ToRad(90) + atan2f(-(curr_pos.x-_center.x), curr_pos.y-_center.y); float bearing_rad = ToRad(90) + fast_atan2(-(curr_pos.x-_center.x), curr_pos.y-_center.y);
_angle = wrap_PI(bearing_rad); _angle = wrap_PI(bearing_rad);
} }
} }