starDistanceLightYearsfunction
A star's distance from its parallax, in light-years.
Import it
import { starDistanceLightYears } from "@johnmorrisdotca/wakusei-planets/stars";
Definition
function starDistanceLightYears(star: Star): number | undefined
Parameters
| Name | Type | Description |
|---|---|---|
star | Star | A star. |
Returns
number | undefined
Light-years, or undefined where the catalogue has no parallax (or a non-positive one).
Examples
import { starByName, starDistanceLightYears } from "@johnmorrisdotca/wakusei-planets/stars";
console.log(starDistanceLightYears(starByName("Sirius")!)?.toFixed(1));8.7What it prints (run when this page was built)