예제 #1
0
        /// <summary>
        /// This updates the star to the current surface temperature given no alterations
        /// </summary>
        /// <param name="ageL">the age line of the star</param>
        /// <param name="lumin">The current luminosity of the star (used for White Dwarfs)</param>
        /// <param name="age">The age of the star</param>
        /// <param name="mass">The current mass of the star</param>
        /// <param name="ourDice">Dice (due to randomization of the temperature)</param>
        /// <returns>The current temperature of the star</returns>
        public static double getCurrentTemp(StarAgeLine ageL, double lumin, double age, double mass, Dice ourDice)
        {
            if (ageL.findCurrentAgeGroup(age) == StarAgeLine.RET_MAINBRANCH)
            {
                return(Star.getInitTemp(mass));
            }
            if (ageL.findCurrentAgeGroup(age) == StarAgeLine.RET_SUBBRANCH)
            {
                return(Star.getInitTemp(mass) - ageL.calcWithInSubLimit(age) * (Star.getInitTemp(mass) - 4800));
            }
            if (ageL.findCurrentAgeGroup(age) == StarAgeLine.RET_GIANTBRANCH)
            {
                return(3000 + ourDice.rng(2, 6, -2) * 200);
            }
            if (ageL.findCurrentAgeGroup(age) == StarAgeLine.RET_COLLASPEDSTAR)
            {
                return(Math.Pow((lumin / Math.Pow(Star.getRadius(mass, 0, lumin, StarAgeLine.RET_COLLASPEDSTAR), 2)) * (5.38937375 * Math.Pow(10, 26)), 1 / 4));
            }

            return(0);
        }