本文へ移動

Hoshi Stars星

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

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

目次

リファレンス · いちばん明るい星の名前と、うすい星座の線 (自分で描く空のために。個数か等級で選べます。ポインターが乗っている星座は濃く表示でき、空をおおうものにも対応し、見た目は設定だけで変えられます)

StarNameLabel型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

One name to draw: the star, the text with the look's case applied, and where everything goes, in the page's pixels. The objects are reused by the next update; copy what you keep.

インポート

import type { StarNameLabel } from "@johnmorrisdotca/hoshi-stars/sky-labels";

定義

interface StarNameLabel {
    hr: number;
    text: string;
    magnitude: number;
    x: number;
    y: number;
    textX: number;
    textY: number;
    anchor: "start" | "end" | "middle";
    designation: string;
    designationX: number;
    designationY: number;
    ring: number;
    x0: number;
    y0: number;
    x1: number;
    y1: number;
    leader: boolean;
    leaderX0: number;
    leaderY0: number;
    leaderX1: number;
    leaderY1: number;
}

メンバー

名前型説明
hrnumber

The star's Bright Star Catalogue number.

textstring

The name to draw, with the look's case applied.

magnitudenumber

The star's visual magnitude.

xnumber

Where the star is on the screen.

ynumber
textXnumber

Where to draw the text: its baseline start (anchor start), end (end) or middle (middle, for a name above or below its star).

textYnumber
anchor"start" | "middle" | "end"
designationstring

The catalogue letter to write under the name (α Ori), or an empty text when the look leaves it out or the star has none; where its baseline starts (anchor as for the name).

designationXnumber
designationYnumber
ringnumber

The radius of the ring to draw round the star; 0 for none.

x0number

The box the name and its catalogue letter take together.

y0number
x1number
y1number
leaderboolean

The short line from the star to the text, from (leaderX0, leaderY0) to (leaderX1, leaderY1); leader is false when the look has none.

leaderX0number
leaderY0number
leaderX1number
leaderY1number

例

import type { StarNameLabel } from "@johnmorrisdotca/hoshi-stars/sky-labels";

const show = (label: StarNameLabel): string => `${label.text} at ${Math.round(label.x)},${Math.round(label.y)}`;
console.log(typeof show);
function

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

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

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