import copy


def ApplyFunToRadii(fiber_bundle, fun):
    """
    Applies function to fibers radii

    Parameters
    ----------
    fiber_bundle : [(,4)-array, ...]
        list of fibers
    fun : function

    Returns
    -------
    res : [(,4)-array, ...]
        translated fiber_bundle
    """

    fiber_bundle = copy.deepcopy(fiber_bundle)
    for i, _ in enumerate(fiber_bundle):
        fiber_bundle[i][:, -1] = fun(fiber_bundle[i][:, -1])
    return fiber_bundle