stars

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package stars derives a simple stellar state from birth mass and age: life stage, surface temperature, luminosity, and radius.

Constants and units come from measure; empirical and chosen parameters come from research data; mainsequence.txt supplies the published dwarf sequence. Comments retain the distinction between measurements and tuning.

Two life stages are implemented: Burning and Ended. Ended currently has no emitted light or remnant model. The fixed fuel fraction is a simplified lifetime model, particularly inaccurate for massive stars.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Life added in v0.0.3

type Life struct {
	// contains filtered or unexported fields
}

Life identifies the implemented stellar stage: Burning or Ended.

func Burning

func Burning() Life

Burning is a star on the main sequence, burning hydrogen.

func Ended

func Ended() Life

Ended marks the end of hydrogen burning. Until remnant models are available, the returned state has no light, temperature, or radius.

func (Life) String added in v0.0.3

func (life Life) String() string

String returns the name of the part of life.

type Star

type Star struct {
	// contains filtered or unexported fields
}

Star stores the modelled state at an age and the light it emits.

func NewStar

func NewStar(mass measure.Mass, age measure.Duration) (*Star, error)

NewStar derives a state from birth mass and age. It rejects masses outside the published main-sequence table and ages below zero or above the universe’s age. NaN also fails these range checks.

func (Star) Life added in v0.0.3

func (star Star) Life() Life

Life returns the part of its life the star is in at its age.

func (Star) Luminosity

func (star Star) Luminosity() measure.Power

Luminosity returns total emitted power across all wavelengths, not only visible light.

func (Star) Radius

func (star Star) Radius() measure.Length

Radius returns stellar radius, or zero in the current Ended model.

func (Star) Temperature

func (star Star) Temperature() measure.Temperature

Temperature returns surface temperature, or zero in the current Ended model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL