リファレンス · 近くの星 (プロキシマ・ケンタウリ、バーナード星など約5,600個、距離と誤差つき)
nearbyStars関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The nearby stars, nearest first (the ones with no distance last). They are the stars of the Yale parallax catalogue that the 5,080 bright stars do not hold, so a star is never in both lists.
インポート
import { nearbyStars } from "@johnmorrisdotca/hoshi-stars/nearby";
定義
function nearbyStars(options?: { magnitude?: number; maxRelativeError?: number; withDistance?: boolean; }): NearbyStar[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
options (省略可) | { magnitude?: number; maxRelativeError?: number; withDistance?: boolean; } |
|
戻り値
NearbyStar[]
A fresh array of the shared, frozen stars.
例
import { nearbyStars } from "@johnmorrisdotca/hoshi-stars/nearby";
const close = nearbyStars({ maxRelativeError: 0.05 }).filter((star) => star.lightYears! < 20);
console.log(close.length > 50, close[0]?.name);true Proxima Centauri出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。