Skip to content

astro.Function.bodyMass

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

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

Function: 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.

Parameters

body

BodyProperties

The body. A planet or moon carries MassEM (Earth masses), a star StellarMass (solar masses).

Returns

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.

Throws

If body is not an object.

Example

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

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