def calc_masses_from_ratio_sum(mass_ratio, mass_sum):
    """Calculate the individual stellar masses from their sum and ratio.
    
    Parameters
    ----------
    mass_ratio : float
        Ratio of stellar masses for stars 1 and 2 as mass1 / mass2. Unitless.
    mass_sum : float
        Sum of stellar masses for stars 1 and 2. Unit is kg.
    
    Returns
    -------
    mass_1 : float
        Mass of star 1. Unit is kg.
    mass_2 : float
        Mass of star 2. Unit is kg.
    
    Notes
    -----
    Note: Masses are returned as a tuple: (m1, m2)
    m1 + m2 = mass_sum
    m1 / m2 = mass_ratio
    => m1 = mass_ratio*m2
       m1 + m2 = m2*(mass_ratio + 1) = mass_sum
       m2 = mass_sum / (mass_ratio + 1)


    """
    mass_2 = mass_sum / (mass_ratio + 1.0)
    mass_1 = mass_ratio * mass_2
    return mass_1, mass_2
