SpaceNeighbour型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A body near the target in space: the distance between their centres, and how far that may be off.
インポート
import type { SpaceNeighbour } from "@johnmorrisdotca/wakusei-planets/nearest";
定義
interface SpaceNeighbour {
id: BodyId;
kind: NearestKind;
distanceKm: number;
distanceAu: number;
uncertaintyKm: number;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
id | BodyId | |
kind | "moon" | "star" | "planet" | "dwarf-planet" | |
distanceKm | number | The distance between the two centres at the date, kilometres. |
distanceAu | number | The same in astronomical units. |
uncertaintyKm | number | The accuracy to expect of |
例
import { nearest, type SpaceNeighbour } from "@johnmorrisdotca/wakusei-planets/nearest";
const next: SpaceNeighbour | undefined = nearest("earth", { by: "space", count: 1, date: Date.UTC(2026, 10, 8) })[0];
console.log(next?.id, Math.round(next?.distanceKm ?? 0));moon 393763出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。