public static final List<Geo> segmentNearPoly(Geo s1,Geo s2,GeoArray r,double near){
  int rlen=r.getSize();
  Geo pl0=r.get(rlen - 1,new Geo());
  Geo pl1=new Geo();
  List<Geo> list=null;
  Geo check=new Geo();
  for (int j=0; j < rlen; j++) {
    r.get(j,pl1);
    Geo ret=segmentsIntersectOrNear(s1,s2,pl0,pl1,near,check);
    if (ret != null) {
      if (list == null) {
        list=new LinkedList<Geo>();
      }
      list.add(ret);
      check=new Geo();
    }
    pl0.initialize(pl1);
  }
  return list;
}

public static final List < Geo > segmentNearPoly ( Geo s1 , Geo s2 , GeoArray r , double near ) { int rlen = r . getSize ( ) ; Geo pl0 = r . get ( rlen - 1 , new Geo ( ) ) ; Geo pl1 = new Geo ( ) ; List < Geo > list = null ; Geo check = new Geo ( ) ; for ( int j = 0 ; j < rlen ; j ++ ) { r . get ( j , pl1 ) ; Geo ret = segmentsIntersectOrNear ( s1 , s2 , pl0 , pl1 , near , check ) ; if ( ret != null ) { if ( list == null ) { list = new LinkedList < Geo > ( ) ; } list . add ( ret ) ; check = new Geo ( ) ; } pl0 . initialize ( pl1 ) ; } return list ; }
where is a segment , represented by endpoints ' s1 ' and ' s2 ' , withing a range ' near ' of region ' r ' ?
