westernconstant
The Western sky as a culture: the 88 constellations, then the asterisms. Pass it to constellations, constellation, starsIn, figures or figureOf for names in every language and the asterisms as well.
Import it
import { western } from "@johnmorrisdotca/hoshi-stars/cultures/western";
Definition
const western: Culture = defineCulture("western", { en: "Western (IAU 88 and asterisms)", ja: "西洋 (88星座と星の並び)" }, (): Asterism[] => [
...iauAsterisms("la"),
...WESTERN_ASTERISM_ROWS.split("\n").map((row): Asterism => {
const [id, en, ja, reading, about, chains] = row.split("|") as [
string,
string,
string,
string,
string,
string
];
return {
id,
name: en,
names: { en, ...(ja === "" ? {} : { ja }) },
readings: ja === "" ? {} : { ja: reading },
aka: [],
about,
kind: "asterism",
group: undefined,
missing: 0,
chains: chains.split(";").map((chain) => chain.split("-").map(Number)),
};
}),
])
Examples
import { figureOf } from "@johnmorrisdotca/hoshi-stars/lines";
import { western } from "@johnmorrisdotca/hoshi-stars/cultures/western";
console.log(figureOf("天鹅座", western).asterism.name, figureOf("夏の大三角", western).stars.map((s) => s.name));Cygnus [ 'Vega', 'Altair', 'Deneb' ]What it prints (run when this page was built)