リファレンス · 星・天体・位置の近くにあるもの (空と宇宙で)、隣り合う星座
NearestInSpace型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
One answer of a query by distance in space.
インポート
import type { NearestInSpace } from "@johnmorrisdotca/hoshi-stars/nearest";
定義
interface NearestInSpace<T extends Star | NearbyStar = Star> {
thing: T;
distance: number;
parsecs: number;
error: number | undefined;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
thing | T | The star. |
distance | number | The distance from the target in light-years, from the two parallaxes and the angle between them. |
parsecs | number | The same distance in parsecs. |
error | number | undefined | The uncertainty of |
例
import { nearest, type NearestInSpace } from "@johnmorrisdotca/hoshi-stars/nearest";
const first: NearestInSpace = nearest("Sirius", { by: "space", count: 1 })[0]!;
console.log(first.thing.name, first.distance.toFixed(1), "light-years");Procyon 5.1 light-years出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。