def abcd2 (x0, y0, a, b, c, x, y):
    """Given an 2D Gaussian expressed as the ABC polynomial coefficients, compute
    a "squared distance parameter" such that

       z = exp (-0.5 * d2)

    Inputs:

    * x0: position of Gaussian center on x axis
    * y0: position of Gaussian center on y axis
    * a: such that z = exp (ax² + bxy + cy²)
    * b: see above
    * c: see above
    * x: x coordinates of the locations for which to evaluate d2
    * y: y coordinates of the locations for which to evaluate d2

    Returns: d2, distance parameter defined as above.

    This is pretty trivial.

    """
    _abccheck (a, b, c)
    dx, dy = x - x0, y - y0
    return -2 * (a * dx**2 + b * dx * dy + c * dy**2)