DistanceAttype
The least or the greatest distance of a pair over a span, and when.
Import it
import type { DistanceAt } from "@johnmorrisdotca/wakusei-planets/nearest";
Definition
interface DistanceAt {
time: Date;
distanceKm: number;
distanceAu: number;
uncertaintyKm: number;
atEdge: boolean;
}
Members
| Name | Type | Description |
|---|---|---|
time | Date | The moment, to about a second of time. |
distanceKm | number | |
distanceAu | number | |
uncertaintyKm | number | The accuracy to expect of |
atEdge | boolean | True when this is the span's start or end, not a turning point inside it. |
Examples
import { distanceRange, type DistanceAt } from "@johnmorrisdotca/wakusei-planets/nearest";
const least: DistanceAt = distanceRange("earth", "mars", { from: Date.UTC(2003, 0, 1), to: Date.UTC(2004, 0, 1) }).min;
console.log(least.time.toISOString().slice(0, 10), least.distanceAu.toFixed(3));2003-08-27 0.373What it prints (run when this page was built)