private int locateAndGetIndex(Point2D loc,boolean preceding,Point2D result){
  double a=loc.getX();
  double o=loc.getY();
  int seg=getSegmentIndexForAdvance(a,preceding);
  map(seg,a,o,result);
  return seg;
}

private int locateAndGetIndex ( Point2D loc , boolean preceding , Point2D result ) { double a = loc . getX ( ) ; double o = loc . getY ( ) ; int seg = getSegmentIndexForAdvance ( a , preceding ) ; map ( seg , a , o , result ) ; return seg ; }
map the point , and return the segment index .
