NearestTargettype
Where a query starts: a star, a deep-sky object, a name starByName or deepSkyObject (the Messier objects) finds, or a point in J2000 degrees. A point may carry lightYears to be used with by: "space". A point in space is { x, y, z } in parsecs on the J2000 equatorial axes with the Sun at the origin (x toward right ascension 0, z toward the north pole), like the star browser of a planetarium; it works by angle too, as the direction from the Sun.
Import it
import type { NearestTarget } from "@johnmorrisdotca/hoshi-stars/nearest";
Definition
type NearestTarget = Star | NearbyStar | DeepSkyObject | string | {
rightAscension: number;
declination: number;
lightYears?: number;
} | {
x: number;
y: number;
z: number;
};
Examples
import { nearest, type NearestTarget } from "@johnmorrisdotca/hoshi-stars/nearest";
const target: NearestTarget = { rightAscension: 83.8, declination: -5.4 };
console.log(nearest(target, { count: 1 })[0]?.thing.name);undefinedWhat it prints (run when this page was built)