allSkyLinefunction
A line on the sky (a figure's segment, a boundary, a meridian) as runs of points of the picture. The line follows great circles between your points, cut every step degrees so a curve
stays smooth, and a line that crosses the seam (the edge, half a turn from the centre) is cut there into two runs that end ON the edge, one at each side, so nothing is drawn across the picture.
Import it
import { allSkyLine } from "@johnmorrisdotca/hoshi-stars/all-sky";
Definition
function allSkyLine(points: readonly SkyPoint[], options: AllSkyOptions, step?: number): AllSkyPoint[][]
Parameters
| Name | Type | Description |
|---|---|---|
points | readonly SkyPoint[] | The sky positions in degrees, in order (a closed outline repeats its first point). |
options | AllSkyOptions | The picture. |
step (optional) | number | The longest piece between two points of a run, in degrees; 2 by default. |
Returns
AllSkyPoint[][]
One run for a line that stays on its side of the seam, more where it crosses; each has at least two points.
Examples
import { allSkyLine } from "@johnmorrisdotca/hoshi-stars/all-sky";
// Two points either side of the galactic anticentre: the line is cut at the edge
const runs = allSkyLine([{ rightAscension: 84, declination: 30 }, { rightAscension: 100, declination: 30 }], { width: 1000, centre: 0 });
console.log(runs.length);2What it prints (run when this page was built)