Constellation3Dtype
A constellation's figure in space.
Import it
import type { Constellation3D } from "@johnmorrisdotca/hoshi-stars/constellation-3d";
Definition
interface Constellation3D {
constellation: Constellation;
viewpoint: {
name: string | undefined;
earth: Point3;
};
stars: StarIn3D[];
segments: Array<[
number,
number
]>;
counts: Record<DistanceQuality, number>;
frame: {
centre: Point3;
up: Point3;
};
radius: number;
}
Members
| Name | Type | Description |
|---|---|---|
constellation | Constellation | The constellation. |
viewpoint | { name: string | undefined; earth: Point3; } | The viewpoint: its name where it is a star, and where the Earth is ( |
stars | StarIn3D[] | The stars of the figure, each once, in the figure's order (the viewpoint star itself is left out). |
segments | [number, number][] | The lines of the figure as pairs of indexes into |
counts | Record<DistanceQuality, number> | How many stars have each quality of distance. |
frame | { centre: Point3; up: Point3; } | The direction from the viewpoint to the middle of the figure, and the direction of "up" (celestial north, turned square to it): a unit vector each. From the middle of the figure looking along |
radius | number | How far the figure's stars lie from |
Examples
import { constellationIn3D, type Constellation3D } from "@johnmorrisdotca/hoshi-stars/constellation-3d";
const orion: Constellation3D = constellationIn3D("Ori");
console.log(orion.stars.length, orion.segments.length, orion.counts);8 8 { good: 0, fair: 1, rough: 6, none: 1 }What it prints (run when this page was built)