code: public int knotAt(int x) {
  		for (int i = 1; i < numKnots-1; i++)
  			if (xKnots[i+1] > x)
  				return i;
  		return 1;
  	}
docs: Return the knot at a given position.
  @param x the position
  @return the knot number, or 1 if no knot found