SeenStartype
One star as seen from a viewpoint: where it is in that sky, how far, and how bright.
Import it
import type { SeenStar } from "@johnmorrisdotca/hoshi-stars/sky-from";
Definition
interface SeenStar {
id: string;
name: string | undefined;
designation: string | undefined;
rightAscension: number;
declination: number;
lightYears: number;
parsecs: number;
magnitude: number;
absoluteMagnitude: number;
colourIndex: number | undefined;
star: Star | NearbyStar | undefined;
}
Members
| Name | Type | Description |
|---|---|---|
id | string | A key that stays the same: |
name | string | undefined | The common name, |
designation | string | undefined | The Bayer letter or Flamsteed number and constellation ( |
rightAscension | number | Right ascension in degrees seen from the viewpoint, 0 up to 360, on the same J2000 equatorial axes as the Earth's sky. |
declination | number | Declination in degrees seen from the viewpoint, -90 to 90. |
lightYears | number | The distance from the viewpoint in light-years. |
parsecs | number | The same distance in parsecs. |
magnitude | number | The apparent visual magnitude from the viewpoint: smaller is brighter. It is the absolute magnitude plus 5 log10(distance / 10 parsecs). |
absoluteMagnitude | number | The visual magnitude the star would have at 10 parsecs, worked out from its magnitude and distance from the Sun. |
colourIndex | number | undefined | The colour index B-V, or |
star | Star | NearbyStar | undefined | The catalogue's star, or |
Examples
import { skyFrom, type SeenStar } from "@johnmorrisdotca/hoshi-stars/sky-from";
const sun: SeenStar = skyFrom("Rigil Kentaurus").find((star) => star.id === "sun")!;
console.log(sun.magnitude.toFixed(2));0.45What it prints (run when this page was built)