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

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

Function: orbitExtents()

orbitExtents(body): OrbitExtents | null

Defined in: src/astro/body-orbit.ts:100

Where a body's orbit actually reaches, from the mean distance and eccentricity the scan wrote.

Parameters

body

BodyProperties

The body. Needs SemiMajorAxis; Eccentricity is taken as 0 when absent, which is what a circular orbit means.

Returns

OrbitExtents | null

The extents in metres, or null when the body has no usable semi-major axis — a single-star system's primary star, which orbits nothing, among them.

Remarks

SemiMajorAxis is an average, and an eccentric orbit spends none of its time there. Periapsis is the figure a Roche breach, a tidal heating argument or a close-approach question turns on.

Throws

If body is not an object.

Example

import { orbitExtents } from '@elite-dangerous-almanac/core/astro/body-orbit';

orbitExtents({ SemiMajorAxis: 1e9, Eccentricity: 0.25 })?.periapsis; // -> 750000000

// No eccentricity written means a circle: both ends sit on the axis.
orbitExtents({ SemiMajorAxis: 1e9 })?.apoapsis; // -> 1000000000

orbitExtents({ MassEM: 1 }); // -> null
⚠️ **GitHub.com Fallback** ⚠️