private void addInterpolated(MutableCoordinateSequence result, CoordinateSequence cs,
    int startIdx, double position) {
    int endIdx = startIdx + 1;
    double startPos = nodeLocations[startIdx];
    double endPos = nodeLocations[endIdx];
    double x1 = cs.getX(startIdx);
    double y1 = cs.getY(startIdx);
    double x2 = cs.getX(endIdx);
    double y2 = cs.getY(endIdx);
    double ratio = (position - startPos) / (endPos - startPos);
    result.addPoint(
      x1 + (x2 - x1) * ratio,
      y1 + (y2 - y1) * ratio
    );
  }
Returns a partial segment of this line from {@code start} to {@code end} where 0 is the beginning of the line and 1
is the end.
planetiler-core/src/main/java/com/onthegomap/planetiler/geo/LineSplitter.java