Figure型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The stick figure of one constellation.
インポート
import type { Figure } from "@johnmorrisdotca/hoshi-stars/lines";
定義
interface Figure {
constellation: Constellation;
stars: Star[];
segments: Array<[
Star,
Star
]>;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
constellation | Constellation | The constellation the figure is drawn in. |
stars | Star[] | The stars the figure uses, each once, in the order the figure first reaches them. |
segments | [Star, Star][] | The lines to draw, each a pair of stars of the constellation, no pair twice. Empty where the figure is one star. |
例
import { figureOf, type Figure } from "@johnmorrisdotca/hoshi-stars/lines";
const orion: Figure = figureOf("Ori");
console.log(orion.constellation.name, orion.stars.length, orion.segments.length);Orion 8 8出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。