Distancetype
The distance between two bodies at one instant: their centres, in the Sun's frame, with no light time.
Import it
import type { Distance } from "@johnmorrisdotca/wakusei-planets/nearest";
Definition
interface Distance {
a: BodyId;
b: BodyId;
time: number;
distanceKm: number;
distanceAu: number;
uncertaintyKm: number;
}
Members
| Name | Type | Description |
|---|---|---|
a | BodyId | |
b | BodyId | |
time | number | The moment, milliseconds since 1970 (UTC). |
distanceKm | number | |
distanceAu | number | |
uncertaintyKm | number | The accuracy to expect of |
Examples
import { distance, type Distance } from "@johnmorrisdotca/wakusei-planets/nearest";
const found: Distance = distance("earth", "moon", Date.UTC(2026, 10, 8));
console.log(Math.round(found.distanceKm), "km");393763 kmWhat it prints (run when this page was built)