class SpikeInterpolation {

    static double interBetween(double lowerY, double upperY, double upperX, double lowerX, double position) {
        if (upperX - lowerX == 0) {
            return lowerY;
        }
        return lowerY + ((upperY - lowerY) * (position - lowerX)) / (upperX - lowerX);
    }

}