本文へ移動

Wakusei Planets惑星

太陽・惑星・衛星を、線画、陰影つきの絵、表面の地図で描きます。実際の大きさ・傾き・自転つきで、任意の日時の衛星の位置も分かります。

「惑星」(わくせい) は、太陽のまわりを回る大きな星のことです。 名前について(英語)

目次

リファレンス · データ・線画・位置

StarLook型

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

A star ready to draw: its numbers with the defaults filled in, its colour, the shaded look and the facts the line drawing uses, how fast it turns on a page, and which parts of the picture are known and which invented.

インポート

import type { StarLook } from "@johnmorrisdotca/wakusei-planets";

定義

interface StarLook {
    numbers: StarNumbers;
    name: string;
    temperatureK: number;
    radiusSun: number;
    radiusKm: number;
    quality: "full" | "low";
    luminosityClass: LuminosityClass;
    rotationDays: number | undefined;
    activity: number;
    oblateness: number;
    corona: number;
    colour: string;
    tone: string;
    look: BodyLook;
    facts: BodyFacts;
    turn: {
        degreesPerSecond: number;
        speedUp: number | undefined;
    };
    parts: readonly StarPart[];
    disclaimer: {
        en: string;
        ja: string;
    };
    key: string;
}

メンバー

名前型説明
numbersStarNumbers

The numbers it was made from, as they were given.

namestring
temperatureKnumber
radiusSunnumber
radiusKmnumber
quality"full" | "low"

Which drawing this is: full or low (see StarLookOptions).

luminosityClass"0" | "Ia" | "Iab" | "Ib" | "II" | "III" | "IV" | "V" | "VI" | "D"
rotationDaysnumber | undefined

undefined when the numbers gave none.

activitynumber
oblatenessnumber
coronanumber
colourstring

The black-body colour of the temperature, #rrggbb.

tonestring

The colour the line drawing and a page's accents take: the bright cells of the shaded look, a little stronger than the plain black body so a star reads as coloured, #rrggbb.

lookBodyLook

The shaded look: its surface is shader code with the numbers written into it. Its id is sun, the one star among the bodies. Draw it through the element's star attribute; it is not registered under a body.

factsBodyFacts

The facts the line drawing uses: the Sun's, with this star's name, size, shape and the outlines of its cells and spots.

turn{ degreesPerSecond: number; speedUp: number | undefined; }

How it turns on a page: degrees a second (negative for backwards), and how many times faster than the star really turns that is (undefined when its rotation is not given).

partsreadonly StarPart[]

Which parts of the picture are measured, estimated, derived or illustrative.

disclaimer{ en: string; ja: string; }

The sentence for a page to show with the picture.

keystring

The same numbers give the same key: the renderer keeps one drawing for each.

例

import { starLook } from "@johnmorrisdotca/wakusei-planets";

const star = starLook({ name: "Sirius A", temperatureK: 9940, radiusSun: 1.71, luminosityClass: "V", rotationDays: 5.5 });
console.log(star.colour, star.disclaimer.en);
#cadaff Sirius A: drawn from its numbers, not a photo.

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

ソースを見るGitHub で編集@johnmorrisdotca/wakusei-planets 0.25.0 のソースから作成しました。

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