Reference · Stars: names, positions, distance and colour
absoluteMagnitudefunction
A star's absolute magnitude: how bright it would look from 10 parsecs (32.6 light-years), from its visual magnitude and its parallax (M = V + 5 + 5 log10(parallax in arc-seconds)). It is the brightness the Hertzsprung-Russell diagram plots against colour. The Sun is 4.83 and Sirius 1.45. The dimming of starlight by interstellar dust is not corrected, so a distant star is a little fainter than it is; the catalogue holds no figure for it.
Import it
import { absoluteMagnitude } from "@johnmorrisdotca/hoshi-stars";
Definition
function absoluteMagnitude(star: Pick<Star, "magnitude" | "parallaxMas">): number | undefined
Parameters
| Name | Type | Description |
|---|---|---|
star | Pick<Star, "magnitude" | "parallaxMas"> | A star, or anything with a visual magnitude and a parallax in milliarcseconds. |
Returns
number | undefined
The absolute magnitude, or undefined where there is no parallax (or a non-positive one). It carries the parallax's error: a star with a poor parallax has a poor absolute magnitude.
Examples
import { absoluteMagnitude, starByName } from "@johnmorrisdotca/hoshi-stars";
console.log(absoluteMagnitude(starByName("Sirius")!)?.toFixed(2));1.45What it prints (run when this page was built)