Documentation / @interstellar-tools/tracking / orbitPath3D
Function: orbitPath3D()
ts
function orbitPath3D(
elements: MeanElementsInterface,
from: Date,
to: Date,
options?: OrbitPath3DOptionsInterface
): Vector3DTupleType[];Defined in: satellites/globe.ts:84
The path of a satellite in 3D, for drawing its orbit around a globe: positions from Earth's centre over time, in the frame and unit a renderer wants.
Propagates the elements with SGP4 (propagate) from from to to, and turns the positions with Earth (temeToEarthFixed) unless the inertial frame is asked for.
Notes
- Earth-fixed or inertial. In the Earth-fixed frame, the ground stays still under the path: the path is the ground track, lifted to the satellite's height, and a geostationary satellite is a point. In the inertial frame, the orbit stays still while Earth turns under it: draw the globe turned by
greenwichMeanSiderealTime. - Axes: x toward 0° longitude (Earth-fixed) or the vernal equinox (inertial), z toward the North Pole. Many 3D engines put y up: swap the axes to suit.
- Positions are divided by
unit: pass Earth's radius to draw on a globe of radius 1.
Parameters
| Parameter | Type | Description |
|---|---|---|
elements | MeanElementsInterface | The mean elements, from parseTle or parseOmm. |
from | Date | Start of the path, as a Date. |
to | Date | End of the path, as a Date after from. |
options? | OrbitPath3DOptionsInterface | step in s (finite, > 0), frame, and unit in m (finite, > 0). |
Returns
The positions, at from, every step after it, and at to, in units of unit.
Throws
- If
fromortois not a validDate,steporunitis not a finite number, or a value ofelementsis not a finite number. - If
tois not afterfrom,steporunitis not > 0,frameis neither'earth-fixed'nor'inertial', the path would have more than a million points, or SGP4 fails along it, as in propagate.
Example
ts
import { WGS84 } from '@interstellar-tools/constants';
const now = new Date();
const later = new Date(now.getTime() + 92 * 60_000);
// One ISS orbit, in Earth radii, around a globe of radius 1
const path = orbitPath3D(iss, now, later, {
frame: 'inertial',
unit: WGS84.equatorialRadius.value
});