def surface_integral(alpha1, alpha2, alpha3, exp1, exp2, exp3, area):
    """
    Calculate the surface integral, special cases for each vertex phase term.
    :param alpha1: The phase at vertex 1 (rad).
    :param alpha2: The phase at vertex 2 (rad).
    :param alpha3: The phase at vertex 3 (rad).
    :param exp1: The exponential term (exp(j k alhpa1).
    :param exp2: The exponential term (exp(j k alpha2).
    :param exp3: The exponential term (exp(j k alpha3).
    :param area: The area of the facet (m^2).
    :return: The surface integral calculation.
    """
    eps = 1e-10
    if abs(alpha1 - alpha2) < eps and abs(alpha1 - alpha3) < eps:
        Ic = area * exp1
    elif abs(alpha1 - alpha2) < eps:
        Ic = 2.0 * area / (alpha3 - alpha2) * (1j * exp1 - (exp1 - exp3) / (alpha1 - alpha3))
    elif abs(alpha1 - alpha3) < eps:
        Ic = 2.0 * area / (alpha3 - alpha2) * (-1j * exp1 + (exp1 - exp2) / (alpha1 - alpha2))
    elif abs(alpha2 - alpha3) < eps:
        Ic = 2.0 * area / (alpha1 - alpha2) * (1j * exp3 - (exp1 - exp3) / (alpha1 - alpha3))
    else:
        Ic = 2.0 * area / (alpha3 - alpha2) * ((exp1 - exp2) / (alpha1 - alpha2) - (exp1 - exp3) / (alpha1 - alpha3))
    return Ic