if(minX == maxX){
throw new IllegalArgumentException("Identical x-values.");
}
double y0 = (maxX * minY - minX * maxY)/(maxX - minX);
double m = (maxY - minY)/(maxX - minX);
result = new TimeCalibration(minX, minY, maxX, maxY, new LinearFunction(y0, m));
break;
default:
result = new TimeCalibration(minX, minY, maxX, maxY, super.interpolate(x, y));
}
return result;