Star Colour-Temperature Calculator Formula

Understand the math behind the star colour-temperature calculator. Each variable explained with a worked example.

Formulas Used

Peak Wavelength

peak_nm = 2.8978e6 / temperature

Approximate B-V

bv_estimate = -3.684 * log10(temperature) + 14.551

Variables

VariableDescriptionDefault
temperatureSurface Temperature(K)5778

How It Works

Star Colour and Temperature

A star's colour is determined by its surface temperature. Hotter stars appear blue-white; cooler stars appear orange-red.

Peak Wavelength (Wien's Law)

lambda_max = 2.8978e6 / T (nm)

Approximate B-V from Temperature

B-V ≈ -3.684 log10(T) + 14.551

This empirical fit works reasonably for main-sequence stars between 3000 and 30 000 K.

Worked Example

A blue star at 10 000 K.

temperature = 10000
  1. 01Peak = 2 897 800 / 10000 = 289.8 nm (ultraviolet)
  2. 02B-V ≈ -3.684 × log10(10000) + 14.551
  3. 03= -3.684 × 4 + 14.551 = -0.185
  4. 04Negative B-V: more blue than visual light, appears blue-white.