예제 #1
0
파일: AATPoint.cpp 프로젝트: Mrdini/XCSoar
bool
AATPoint::check_target_inside(const AIRCRAFT_STATE& state) 
{
  // target must be moved if d(p_last,t)+d(t,p_next) 
  //    < d(p_last,state)+d(state,p_next)

  if (close_to_target(state)) {
    if (positive(double_leg_distance(state.Location)
                 -double_leg_distance(get_location_max()))) {
      // no improvement available
      return false;
    } else {
      m_target_location = state.Location;
      return true;
    }
  } else {
    return false;
  }
}
예제 #2
0
파일: AATPoint.cpp 프로젝트: hnpilot/XCSoar
bool
AATPoint::check_target_inside(const AIRCRAFT_STATE& state) 
{
  // target must be moved if d(p_last,t)+d(t,p_next) 
  //    < d(p_last,state)+d(state,p_next)

  if (close_to_target(state)) {
    const fixed d_to_max = state.Location.distance(get_location_max());
    if (d_to_max <= fixed_zero) {
      // no improvement available
      return false;
    } else {
      m_target_location = state.Location;
      return true;
    }
  } else {
    return false;
  }
}