Refactor comments
This commit is contained in:
@ -2,17 +2,21 @@ import java.awt.*;
|
||||
|
||||
public class SpaceDraw {
|
||||
|
||||
// Returns the approximate radius of a celestial body with the specified mass.
|
||||
// (It is assumed that the radius r is related to the mass m of the body by r = m ^ 0.5,
|
||||
// where m and r measured in solar units.)
|
||||
/**
|
||||
* Returns the approximate radius of a celestial body with the specified mass.
|
||||
* (It is assumed that the radius r is related to the mass m of the body by r = m ^ 0.5,
|
||||
* where m and r measured in solar units.)
|
||||
*/
|
||||
public static double massToRadius(double mass) {
|
||||
|
||||
return Simulation.SUN_RADIUS * (Math.pow(mass / Simulation.SUN_MASS, 0.5));
|
||||
}
|
||||
|
||||
// Returns the approximate color of a celestial body with the specified mass. The color of
|
||||
// the body corresponds to the temperature of the body, assuming the relation of mass and
|
||||
// temperature of a main sequence star.
|
||||
/**
|
||||
* Returns the approximate color of a celestial body with the specified mass. The color of
|
||||
* the body corresponds to the temperature of the body, assuming the relation of mass and
|
||||
* temperature of a main sequence star.
|
||||
*/
|
||||
public static Color massToColor(double mass) {
|
||||
Color color;
|
||||
if (mass < Simulation.SUN_MASS / 10) {
|
||||
@ -26,7 +30,9 @@ public class SpaceDraw {
|
||||
return color;
|
||||
}
|
||||
|
||||
// Returns the approximate color of temperature 'kelvin'.
|
||||
/**
|
||||
* Returns the approximate color of temperature 'kelvin'.
|
||||
*/
|
||||
private static Color kelvinToColor(int kelvin) {
|
||||
|
||||
double k = kelvin / 100D;
|
||||
@ -41,7 +47,9 @@ public class SpaceDraw {
|
||||
);
|
||||
}
|
||||
|
||||
// A transformation used in the method 'kelvinToColor'.
|
||||
/**
|
||||
* A transformation used in the method 'kelvinToColor'.
|
||||
*/
|
||||
private static int limitAndDarken(double color, int kelvin) {
|
||||
|
||||
int kelvinNorm = kelvin - 373;
|
||||
|
Reference in New Issue
Block a user