public Collection<PlaPointIntDist> nearest_border_projections(PlaPointInt p_point,int p_max_result_points){
  TreeSet<PlaPointIntDist> risul=new TreeSet<PlaPointIntDist>();
  if (!contains(p_point))   return risul;
  if (p_max_result_points <= 0)   return risul;
  p_max_result_points=Math.min(p_max_result_points,8);
  PlaPointFloat inside_point=p_point.to_float();
  for (  PlaDirection curr_dir : eight_45_degree) {
    PlaPointInt curr_border_point=border_point(p_point,curr_dir);
    double curr_dist=inside_point.distance_square(curr_border_point.to_float());
    PlaPointIntDist a_value=new PlaPointIntDist(curr_border_point,curr_dist);
    risul.add(a_value);
  }
  return risul;
}

public Collection < PlaPointIntDist > nearest_border_projections ( PlaPointInt p_point , int p_max_result_points ) { TreeSet < PlaPointIntDist > risul = new TreeSet < PlaPointIntDist > ( ) ; if ( ! contains ( p_point ) ) return risul ; if ( p_max_result_points <= 0 ) return risul ; p_max_result_points = Math . min ( p_max_result_points , 8 ) ; PlaPointFloat inside_point = p_point . to_float ( ) ; for ( PlaDirection curr_dir : eight_45_degree ) { PlaPointInt curr_border_point = border_point ( p_point , curr_dir ) ; double curr_dist = inside_point . distance_square ( curr_border_point . to_float ( ) ) ; PlaPointIntDist a_value = new PlaPointIntDist ( curr_border_point , curr_dist ) ; risul . add ( a_value ) ; } return risul ; }
calculates the sorted p_max_result_points nearest points on the border of this octagon in the 45 - degree directions . p_point is assumed to be located in the inside of this octagon .
