本文へ移動

Hoshi Stars星

肉眼で見える星の名前・色・距離、88星座の線と境界、メシエ天体、そしてそれらを描くための7種類の図法を使えます。

「星」(ほし) は、夜空に光って見えるものです。 名前について(英語)

目次

リファレンス · 距離で見る空 (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;
}

メンバー

名前型説明
limitnumber

The limit the layers were made for, in light-years; Infinity for all.

thingsLayeredThing[]

The things within the limit, nearest first: the certain ones by their best distance, the uncertain ones by the nearest their error allows.

countsnumber[]

How many certain things are in each of the six bands.

uncertainnumber

How many things are in the uncertain band: those whose distance is rough and whose range reaches inside the limit.

unknownnumber

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/hoshi-stars 0.47.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。