def _find_quadratic_peak(y):
    """Given an array of 3 numbers in which the first and last numbers are
    less than the central number, determine the array index at which a
    quadratic curve through the 3 points reaches its peak value.

    Parameters
    ----------
    y  : float,float,float
      The values of the curve at x=0,1,2 respectively. Note that y[1]
      must be greater than both y[0] and y[2]. Otherwise +/- infinity
      will be returned.

    Returns
    -------
    xpeak : float
      The floating point array index of the peak of the quadratic. This
      will always be in the range 0.0 to 2.0, provided that y[0]<y[1] and
      y[2]<y[1].

    """

    # Given the three equations:
    #
    #  a * x0**2 + b * x0 + c = y0
    #  a * x1**2 + b * x1 + c = y1
    #  a * x2**2 + b * x2 + c = y2
    #
    # a, b, and c are given by:
    #
    #  a =  0.5 * y0 - y1 + 0.5 * y2
    #  b = -1.5 * y0 + 2.0 * y1 - 0.5 * y2
    #  c = y0

    a = 0.5 * y[0] - y[1] + 0.5 * y[2]
    b = -1.5 * y[0] + 2.0 * y[1] - 0.5 * y[2]

    # Quadratic curves peak at:  x = -b / (2*a)
    return -b / (2 * a)