'Two dimensional Sersic profile function.'

@classmethod
def evaluate(cls, x, y, amplitude, r_eff, n, x_0, y_0, ellip, theta):

    if (cls._gammaincinv is None):
        try:
            from scipy.special import gammaincinv
            cls._gammaincinv = gammaincinv
        except ValueError:
            raise ImportError(u'Sersic2D    model    requires    scipy    >    0.11.')
    bn = cls._gammaincinv((2.0 * n), 0.5)
    (a, b) = (r_eff, ((1 - ellip) * r_eff))
    (cos_theta, sin_theta) = (np.cos(theta), np.sin(theta))
    x_maj = (((x - x_0) * cos_theta) + ((y - y_0) * sin_theta))
    x_min = (((- (x - x_0)) * sin_theta) + ((y - y_0) * cos_theta))
    z = np.sqrt((((x_maj / a) ** 2) + ((x_min / b) ** 2)))
    return (amplitude * np.exp(((- bn) * ((z ** (1 / n)) - 1))))
