Skip to content

astro.Function.spinOrbitResonance

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

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

Function: spinOrbitResonance()

spinOrbitResonance(body): SpinOrbitResonance | null

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

The simple whole-number resonance between a body's spin and its orbit, when there is one.

Parameters

body

BodyProperties

The body. Needs RotationPeriod and OrbitalPeriod. Both are seconds, and only their ratio matters.

Returns

SpinOrbitResonance | null

The resonance, or null when either period is missing or the ratio is not close to any simple one — most bodies are in no resonance at all.

Remarks

A body in a spin-orbit resonance turns a whole number of times for a whole number of orbits. 1:1 is tidal locking — one face kept to the primary, which the scan also reports as TidalLock — and 3:2 is the next most common, the resonance Mercury sits in.

Both terms are searched up to 5, and a ratio counts as a resonance when it lands within 1% of it. A retrograde rotation is written as a negative period; the resonance is a ratio of magnitudes, so a retrograde tidally-locked body still reads 1:1.

Throws

If body is not an object.

Example

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

// One rotation per orbit: tidally locked.
spinOrbitResonance({ RotationPeriod: 86400, OrbitalPeriod: 86400 }); // -> { rotations: 1, orbits: 1 }

// Mercury: three rotations every two orbits.
spinOrbitResonance({ RotationPeriod: 5067360, OrbitalPeriod: 7600544 }); // -> { rotations: 3, orbits: 2 }

spinOrbitResonance({ RotationPeriod: 86400, OrbitalPeriod: 271828 }); // -> 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