public final class Star extends Object
A catalog record is parsed into this simple structure, which carries only the data needed for the starfield calculation, and nothing else. All other data from the catalog is ignored.
This class also converts spectral type and color index to a corresponding approximate temperature. The resulting temperature is then converted to a corresponding approximate color.
Modifier and Type | Field and Description |
---|---|
double |
Declination
Declination of the star in radians.
|
double |
Magnitude
The brightness of the star.
|
double |
RightAscension
Right Ascension of the star in radians.
|
double |
Temperature
The black-body surface temperature of the star in Kelvin.
|
Constructor and Description |
---|
Star() |
Modifier and Type | Method and Description |
---|---|
static double |
colorIndexToTemperature(double aColorIndex)
Simple mapping of color index to a representative approximate temperature in Kelvin.
|
static double |
spectralTypeToTemperature(String aSpectralClass)
Simple mapping of the first letter of a star's spectral type to a representative approximate temperature in Kelvin.
|
static Color |
temperatureToColor(double temperature)
Map a star's black body surface temperature in Kelvin to a corresponding color.
|
String |
toString()
For debugging only.
|
public double RightAscension
public double Declination
public double Magnitude
public double Temperature
public Star()
public static double spectralTypeToTemperature(String aSpectralClass)
The adopted values are:
Spectral Type | Temperature |
---|---|
O | 30,000 |
B | 20,000 |
A | 8,750 |
F | 6,750 |
G | 5,600 |
K | 4,450 |
M | 3,050 |
public static double colorIndexToTemperature(double aColorIndex)
The adopted values are:
B-V(start) | B-V(end) | Temperature |
---|---|---|
-nn.n | -0.32 | 30,000 |
-0.31 | -0.01 | 20,000 |
+0.00 | +0.29 | 8,750 |
+0.30 | +0.56 | 6,750 |
+0.57 | +0.80 | 5,600 |
+0.81 | +1.38 | 4,450 |
+1.39 | +nn.n | 3,050 |
public static Color temperatureToColor(double temperature)
Starfield - Copyright Hirondelle Systems. Published March 1, 2014