import math


def generic(zeff: float, radius: float, rpow: float = 1, apow: float = 1) -> float:
    """
    Calculate the electronegativity from a general formula

    Args:
        zeff: effective nuclear charge
        radius: radius value for the element
        rpow: power to raise the radius to (see equation below)
        apow: power to raise the fraction to (see equation below)

    .. math::

        \chi = \left(\\frac{Z_{\\text{eff}}}{r^{\\beta}}\\right)^{\\alpha}

    where:

    - :math:`Z_{\\text{eff}}` is the effective nuclear charge
    - :math:`r` is the covalent radius
    - :math:`\\alpha,\\beta` parameters
    """

    return math.pow(zeff / math.pow(radius, rpow), apow)