PointImpl endPos = new PointImpl(points.get(idx+1).getX(),points.get(idx+1).getY());
double partialLen = startPos.distance(endPos);
double rest = pos-len;
double fact = rest/partialLen;
Vector out = startPos.add((endPos.sub(startPos).scale(fact)));
return new PointImpl(out.getX(),out.getY());
}else{
return points.get(points.size()-1); // just return last point
}
}catch(Exception e){