NearStartype
One star system within 20 light-years: a single star or a group, at a place on the sky, with its distance and where each value comes from. Positions are J2000.
Import it
import type { NearStar } from "@johnmorrisdotca/hoshi-stars/near-stars";
Definition
interface NearStar {
id: string;
name: string;
nameJa: string | undefined;
designation: string;
aliases: readonly string[];
constellation: string;
starsAtLeast: number;
rightAscension: number;
declination: number;
positionErrorArcsec: number | undefined;
parallaxMas: number;
parallaxErrorMas: number | undefined;
lightYears: number;
lightYearsError: number | undefined;
spectralType: string | undefined;
luminosityClass: LuminosityClass | undefined;
magnitude: number | undefined;
properMotionRaMas: number;
properMotionDecMas: number;
members: readonly NearStarMember[];
flags: NearStarFlags;
sources: NearStarSources;
}
Members
| Name | Type | Description |
|---|---|---|
id | string | A key that stays the same: |
name | string | The system's name ( |
nameJa | string | undefined | The name in Japanese where known, else |
designation | string | The Bayer letter and constellation, the catalogue's name or its number ( |
aliases | readonly string[] | Other names the sources give it, for |
constellation | string | The IAU three-letter constellation abbreviation the system lies in ( |
starsAtLeast | number | The number of stars in the system as published for the well-known multiples, at least: 3 for Alpha Centauri, 1 for a star with no known companion. |
rightAscension | number | Right ascension of the primary star in degrees at J2000, 0 up to 360. |
declination | number | Declination of the primary star in degrees at J2000, -90 to 90. |
positionErrorArcsec | number | undefined | The error of the position in arc-seconds where the table gives one (2MASS and Yale positions), else |
parallaxMas | number | The annual parallax of the primary in milliarcseconds. |
parallaxErrorMas | number | undefined | The standard error of |
lightYears | number | The distance in light-years: 3,261.56 divided by the parallax in milliarcseconds. |
lightYearsError | number | undefined | The error of |
spectralType | string | undefined | The spectral type of the primary, or |
luminosityClass | LuminosityClass | undefined | The luminosity class in |
magnitude | number | undefined | The V magnitude of the primary, or |
properMotionRaMas | number | Proper motion in right ascension in milliarcseconds a year, already multiplied by cos(declination); 0 where there is none ( |
properMotionDecMas | number | Proper motion in declination in milliarcseconds a year; 0 where there is none. |
members | readonly NearStarMember[] | The stars of the system, the primary first, then the companions the sources give; a companion typed in has no position of its own. |
flags | NearStarFlags | What to be careful about. |
sources | NearStarSources | Where each value comes from. |
Examples
import { nearStarByName, type NearStar } from "@johnmorrisdotca/hoshi-stars/near-stars";
const proxima: NearStar = nearStarByName("Proxima Centauri")!;
console.log(proxima.name, proxima.nameJa, proxima.lightYears.toFixed(2), proxima.sources.distance);Alpha Centauri ケンタウルス座α星 4.35 GCTPWhat it prints (run when this page was built)