constellationIn3Dfunction
A constellation's figure in space: each star of the figure placed from its right ascension, declination and parallax, with the nearest and farthest places its parallax error allows, and the Earth's line of sight to it.
The positions are the catalogue's, so they are as good as its parallaxes (see distanceQuality): the Yale catalogue's are ground-based and many carry errors larger than the parallax. A star with no parallax is never given a
guessed distance: it has no position, only its line of sight (sight). Seen from the Earth, the stars appear where the sky chart puts them, whatever their distances.
With from, the viewpoint moves to another star or point: every position is relative to it, so the figure is seen from there. A star with no parallax has no place to be seen from there, but its Earth line of sight is still a line in space.
Import it
import { constellationIn3D } from "@johnmorrisdotca/hoshi-stars/constellation-3d";
Definition
function constellationIn3D(text: string, options?: { from?: Viewpoint3D; }): Constellation3D
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The constellation, as the IAU abbreviation ( |
options (optional) | { from?: Viewpoint3D; } |
|
Returns
Constellation3D
The figure in space.
Examples
Example 1
import { constellationIn3D } from "@johnmorrisdotca/hoshi-stars/constellation-3d";
const orion = constellationIn3D("Ori");
for (const { star, lightYears, range, quality } of orion.stars) console.log(star.name ?? star.designation, lightYears?.toFixed(0), range?.map((n) => n.toFixed(0)), quality);Betelgeuse 548 [ '480', '640' ] fair
Bellatrix 117 [ '76', '253' ] rough
Alnitak 136 [ '84', '366' ] rough
Mintaka 336 [ '196', '1165' ] rough
Alnilam undefined undefined none
Saiph 247 [ '116', 'Infinity' ] rough
Rigel 847 [ '593', '1483' ] rough
Hatysa 143 [ '83', '502' ] roughWhat it prints (run when this page was built)
Example 2
import { constellationIn3D } from "@johnmorrisdotca/hoshi-stars/constellation-3d";
const fromProxima = constellationIn3D("Cas", { from: "Rigil Kentaurus" });
console.log(fromProxima.viewpoint.earth.map((n) => n.toFixed(1)), fromProxima.counts);[ '1.6', '1.4', '3.8' ] { good: 0, fair: 2, rough: 3, none: 0 }What it prints (run when this page was built)