def METHOD_NAME(
    factor_of_safety: Union[float, np.ndarray], slope: Union[float, np.ndarray]
) -> Union[float, np.ndarray]:
    """
    Calculates the critical acceleration, i.e. the acceleration at which the
    slope fails.
    :param factor_of_safety:
        Static Factor of Safety for the site in question.
    :param slope:
        Slope of site in degrees.
    :returns:
        Critical acceleration in terms of g (9.81 m s^-2)
    """
    crit_accel = (factor_of_safety - 1) * np.sin(np.radians(slope)) * g
    if np.isscalar(crit_accel):
        return max([0., crit_accel])
    else:
        return np.array([max([0., ca]) for ca in crit_accel])