def scaling_func(mag, ref, slope, ref_mag):
    """
    Genaral form for cluster member scaling relations in equations 3 and 4 of Bergamini et al. 2019

    :param mag: cluster member magnitude
    :param ref: reference value (reference velocity dispersion or reference core radius or reference truncation radius) corrisponding to the reference magnitude *ref_mag
    :param slope: scaling relation slope
    :param ref_mag: scaling relation referece magnitude
    :return: scaled value (velocity dispersion or core radius or truncation radius)
    """
    return ref * 10 ** (((ref_mag - mag) * slope) / 2.5)