リファレンス · 距離で見る空 (10・50・100・500・1,000光年より近い星や銀河を層に分けて、距離の帯ごとに色分けします。距離がはっきりしないものは別にし、推測で置くことはしません)
DistanceLayers型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What layersByDistance gives back.
インポート
import type { DistanceLayers } from "@johnmorrisdotca/hoshi-stars/distance";
定義
interface DistanceLayers {
limit: number;
things: LayeredThing[];
counts: number[];
uncertain: number;
unknown: number;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
limit | number | The limit the layers were made for, in light-years; |
things | LayeredThing[] | The things within the limit, nearest first: the certain ones by their best distance, the uncertain ones by the nearest their error allows. |
counts | number[] | How many certain things are in each of the six bands. |
uncertain | number | How many things are in the |
unknown | number | How many things were given with no distance at all. They are never drawn once a limit is set. |
例
import type { DistanceLayers } from "@johnmorrisdotca/hoshi-stars/distance";
const total = (layers: DistanceLayers): number => layers.counts.reduce((sum, n) => sum + n, 0) + layers.uncertain;
console.log(typeof total);function出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。