Reference · Satellites: orbital elements in, positions out
missionPositionfunction
Where a craft was at a moment, from the element set nearest in time (SGP4, the same as createSatellites). Elements more than two days from the moment give nothing, and so does a moment outside a flight when you pass its
mission (the orbiter is on the ground before liftoff and after landing). The sets of one craft are read once and kept for the next call.
Import it
import { missionPosition } from "@johnmorrisdotca/chikyu-earth/satellites";
Definition
function missionPosition(sets: readonly ElementSet[], ms: number, mission?: Mission): MissionPosition | undefined
Parameters
| Name | Type | Description |
|---|---|---|
sets | readonly ElementSet[] | The craft's element sets (from |
ms | number | The moment, in milliseconds since the Unix epoch. |
mission (optional) | Mission | undefined | The flight, to hold the moment between its liftoff and landing when the sets are the flight's own craft (its |
Returns
MissionPosition | undefined
The place, or undefined when there is none at that moment.
Examples
import { missionPosition } from "@johnmorrisdotca/chikyu-earth/satellites";
const sets = [
{
OBJECT_NAME: "STS 1 (OFT-1)",
EPOCH: "1981-04-12T11:53:25.728288",
MEAN_MOTION: 16.10930225,
ECCENTRICITY: 0.0008761,
INCLINATION: 40.3505,
RA_OF_ASC_NODE: 262.129,
ARG_OF_PERICENTER: 212.5283,
MEAN_ANOMALY: 147.5016,
NORAD_CAT_ID: 12399,
BSTAR: 0.002351,
MEAN_MOTION_DOT: 0.02496602,
MEAN_MOTION_DDOT: 0.0000043266,
},
];
const place = missionPosition(sets, Date.UTC(1981, 3, 12, 14));
console.log(place?.latitude.toFixed(1), place?.longitude.toFixed(1), place?.altitudeKm.toFixed(0));18.7 7.6 240What it prints (run when this page was built)