Skip to content

astro.Function.schwarzschildRadius

github-actions[bot] edited this page Aug 28, 2026 · 1 revision

@elite-dangerous-almanac/core / astro / schwarzschildRadius

Function: schwarzschildRadius()

schwarzschildRadius(body): number | null

Defined in: src/astro/star-physics.ts:236

The Schwarzschild radius for a body's mass, in metres.

Parameters

body

BodyProperties

The body. Needs a mass — see bodyMass in ./body-physics. Stars are the bodies this is asked about, but the relation is general and a planet's mass answers too.

Returns

number | null

The radius in metres, or null when no usable mass is written.

Remarks

r_s = 2GM/c². For a black hole this is the event horizon itself, and the game reports no radius for one; for anything else it is how small that mass would have to be squeezed to become one, which is what makes it worth comparing against a neutron star's actual radius — the ratio is how close the star sits to collapse.

Throws

If body is not an object.

Example

import { schwarzschildRadius } from '@elite-dangerous-almanac/core/astro/star-physics';

// The Sun would have to fit inside about 3 km.
schwarzschildRadius({ StellarMass: 1 }); // -> 2954.1…

// A neutron star of two solar masses sits a few times outside its own horizon.
schwarzschildRadius({ StellarMass: 2 }); // -> 5908.2…

API

Guides
astro
Classes (1)
ProceduralSystem

Properties

Accessors

Methods

Interfaces (28)
Type Aliases (6)
Variables (22)
Functions (57)
Subpath modules (3)
commodities
Interfaces (1)
Type Aliases (1)
Variables (3)
Functions (3)
equipment
Interfaces (6)
Type Aliases (8)
Variables (3)
Functions (10)
Subpath modules (2)
i18n
Interfaces (1)
Type Aliases (1)
Functions (17)
materials
Enumerations (2)
Interfaces (2)
Type Aliases (2)
Variables (9)
Functions (9)
ships
Classes (3)
BuildMetrics

Methods

LoadoutEditError

Constructors

Properties

Methods

ShipLoadout

Accessors

Methods

Interfaces (125)
Type Aliases (44)
Variables (10)
Functions (85)
Subpath modules (8)

Clone this wiki locally