Documentation / @interstellar-tools/types / StarInterface
Interface: StarInterface
Defined in: celestial-bodies/stars.ts:39
Represents a star.
A star is bound to one parent: a galaxy for a single star like Vega, or a system barycenter for a star in a planetary, binary or multiple system. Its orbit describes the motion around that parent. A star without a parent is unbound, like a hypervelocity star leaving its galaxy.
Classification & Visualization:
- Type (
type): Spectral classification of the star (e.g.,'G2V'). - Category (
category): Defined as'star'. - Drawing (
display): colour, and state a renderer computes; see DisplayInterface.
Example
const vega: StarInterface = {
id: 'vega',
name: 'Vega',
type: 'A0V',
category: 'star',
parent: 'milky-way',
orbit: {
a: { value: 27230, unit: 'ly' },
e: 0.005,
period: { value: 480, unit: 'Myr' },
angle: 1.5699 as Radians
},
radius: { value: 2600000, unit: 'km' },
display: { color: 'blue' }
};Properties
category
category: 'star';Defined in: celestial-bodies/stars.ts:47
Defines the category as a star.
display?
optional display?: DisplayInterface;Defined in: celestial-bodies/stars.ts:68
How to draw the star: its colour, and state a renderer computes.
id
id: string;Defined in: celestial-bodies/stars.ts:41
Stable identifier, used by parent references. Never translated.
mass?
optional mass?: number;Defined in: celestial-bodies/stars.ts:53
Mass in solar masses (
mu?
optional mu?: number;Defined in: celestial-bodies/stars.ts:58
Standard gravitational parameter
name
name: string;Defined in: celestial-bodies/stars.ts:43
Name of the star.
orbit?
optional orbit?: OrbitInterface;Defined in: celestial-bodies/stars.ts:51
Orbit around the parent.
parent?
optional parent?: string;Defined in: celestial-bodies/stars.ts:49
Id of the galaxy or system the star is bound to.
radius
radius: DistanceInterface;Defined in: celestial-bodies/stars.ts:60
Physical radius of the star.
type
type: string;Defined in: celestial-bodies/stars.ts:45
Spectral classification of the star (e.g., 'G2V').
x?
optional x?: DistanceInterface;Defined in: celestial-bodies/stars.ts:62
X-coordinate in the parent's frame.
y?
optional y?: DistanceInterface;Defined in: celestial-bodies/stars.ts:64
Y-coordinate in the parent's frame.
z?
optional z?: DistanceInterface;Defined in: celestial-bodies/stars.ts:66
Z-coordinate in the parent's frame.