astro.Function.bodyMass - Elite-Dangerous-Almanac/Almanac-Core GitHub Wiki
@elite-dangerous-almanac/core / astro / bodyMass
bodyMass(
body):number|null
Defined in: src/astro/body-physics.ts:104
A body's mass in kilograms, whichever unit the scan wrote it in.
The body. A planet or moon carries MassEM (Earth masses), a star StellarMass (solar masses).
number | null
The mass in kilograms, or null when the scan wrote neither field usably. When
a record carries both — which no journal line does — MassEM is the one read.
If body is not an object.
import { bodyMass } from '@elite-dangerous-almanac/core/astro/body-physics';
bodyMass({ MassEM: 1 }); // -> 5.972e24
bodyMass({ StellarMass: 1 }); // -> 1.989e30
bodyMass({ Radius: 6_371_000 }); // -> null