code: public int getIntervalNumber(double x) {
  		if (x<points[0]) {
  			return 0;
  		} else if (x>=points[points.length-1]) {
  			return points.length;
  		}
  		for(int i=0; i<points.length-2;i++) {
  			if ( x< points[i+1]) {
  				return i+1;
  			}
  		}
  		return points.length-1;
  	}
docs: Returns for a given x the number of the interval where x is included. Note that the intervals are of the type
  [x_i,x_{i+1}). The first interval has number 1, the second number 2 and so on. If x is smaller than the minimum
  of the partition, the method return 0. If x is greater or equal the maximum of the partition, it returns the
  length of the partition.
  
  @param x The point of interest.
  @return The number of the intervals which contains x.