Reference · Satellites: orbital elements in, positions out
closeApproachfunction
The closest the two satellites come between from and to. The span is sampled every stepMs (60 seconds when left out), and the moment of the closest sample is then refined between its two neighbours,
to a tenth of a second, because two satellites close in at several kilometres a second and the closest sample alone can be hundreds of kilometres too far. The uncertainty is the elements' own: the
square root of the sum of the squares of the two satellites' rough uncertainties (1 km, and 1 km more for each day the elements have aged at that moment), not a published covariance.
Two SGP4 calls a sample, and about 20 more for the refinement. It does not run again by itself.
Import it
import { closeApproach } from "@johnmorrisdotca/chikyu-earth/satellites";
Definition
function closeApproach(group: Satellites, a: number, b: number, from: number, to: number, stepMs?: number): { at: number; kilometres: number; uncertaintyKm: number; } | null
Parameters
| Name | Type | Description |
|---|---|---|
group | Satellites | The satellites. |
a | number | The index of one satellite. |
b | number | The index of the other. |
from | number | The start, milliseconds since the Unix epoch. |
to | number | The end. |
stepMs (optional) | number | The sample step, at least 1000. |
Returns
{ at: number; kilometres: number; uncertaintyKm: number; } | null
The closest moment, or null when either satellite cannot be placed.
Examples
import { closeApproach, createSatellites } from "@johnmorrisdotca/chikyu-earth/satellites";
const group = createSatellites([]);
console.log(closeApproach(group, 0, 1, 0, 60_000));nullWhat it prints (run when this page was built)