withinfunction
Everything within a radius of a target, nearest first: nearest with no count limit and within set to the radius.
Import it
import { within } from "@johnmorrisdotca/hoshi-stars/nearest";
Definition
function within(target: NearestTarget, radius: number, options: SkyOptions & { kind: "deep-sky"; among?: undefined; }): NearestList<NearestInSky<DeepSkyObject>>
function within<T extends NearestThing>(target: NearestTarget, radius: number, options: SkyOptions & { kind?: "star" | "deep-sky"; among: readonly T[]; }): NearestList<NearestInSky<T>>
function within(target: NearestTarget, radius: number, options?: SkyOptions & { kind?: "star"; among?: undefined; }): NearestList<NearestInSky>
function within<T extends NearestThing>(target: NearestTarget, radius: number, options: NearestOptions & { by: "space"; among: readonly T[]; }): NearestList<NearestInSpace<Extract<T, Star | NearbyStar>>>
function within(target: NearestTarget, radius: number, options: NearestOptions & { by: "space"; }): NearestList<NearestInSpace>
function within(target: NearestTarget, radius: number, options: NearestOptions): NearestList<NearestInSky<NearestThing> | NearestInSpace<Star | NearbyStar>>
Parameters
| Name | Type | Description |
|---|---|---|
target | NearestTarget | As for |
radius | number | Degrees by angle, light-years by space (0 or more). |
options | NearestOptions | As for |
Returns
NearestList<NearestInSky<NearestThing> | NearestInSpace<Star | NearbyStar>>
As for nearest.
Examples
import { within } from "@johnmorrisdotca/hoshi-stars/nearest";
console.log(within("Alcyone", 2, { magnitude: 5 }).length);5What it prints (run when this page was built)