Reference · Constellation lines
Figuretype
The stick figure of one constellation.
Import it
import type { Figure } from "@johnmorrisdotca/hoshi-stars/lines";
Definition
interface Figure {
constellation: Constellation;
stars: Star[];
segments: Array<[
Star,
Star
]>;
}
Members
| Name | Type | Description |
|---|---|---|
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. |
Examples
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 8What it prints (run when this page was built)