astro.Function.schwarzschildRadius - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki

@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…
⚠️ **GitHub.com Fallback** ⚠️