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

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

Function: primaryAngularDiameter()

primaryAngularDiameter(body, primary): number | null

Defined in: src/astro/body-physics.ts:299

How large the body it orbits appears in a body's sky, as an angular diameter in degrees.

Parameters

body

BodyProperties

The body being stood on. Needs SemiMajorAxis.

primary

BodyProperties

The body it orbits. Needs Radius.

Returns

number | null

The angular diameter in degrees, or null when the orbit or the primary's radius is missing.

Remarks

2 · atan(R_primary / a), taken exactly rather than through the small-angle approximation 2R/a: the two diverge by percent at the tens of degrees a parent actually subtends from a close moon, which is the range worth asking about. A landable moon whose primary fills 45° of sky is a view; one at 0.5° is a dot.

Distance is the body's own semi-major axis, centre to centre, so the figure is the mean.

Throws

If either argument is not an object.

Example

import { primaryAngularDiameter } from '@elite-dangerous-almanac/core/astro/body-physics';

// A primary as far away as it is wide fills a right angle of sky.
primaryAngularDiameter({ SemiMajorAxis: 1e9 }, { Radius: 1e9 }); // -> 90

// Earth's Moon, looking back: Earth subtends about 2°.
primaryAngularDiameter({ SemiMajorAxis: 3.844e8 }, { Radius: 6_371_000 }); // -> 1.899…
⚠️ **GitHub.com Fallback** ⚠️