@ Override public double getY ( double x ) { double slope = getSlope ( ) ; double a = getYIntercept ( slope ) ; if ( ! Double . isInfinite ( slope ) ) { return slope * x + a ; } else { if ( x == a ) { return Double . POSITIVE_INFINITY ; } else { return Double . NaN ; } } }
Returns y - value for x