예제 #1
0
파일: AATPoint.cpp 프로젝트: hnpilot/XCSoar
bool 
AATPoint::close_to_target(const AIRCRAFT_STATE& state, const fixed threshold) const
{
  if (!valid())
    return false;

  return (double_leg_distance(m_target_location)-double_leg_distance(state.Location)
          <= threshold);
}
예제 #2
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;
  }
}