Reference · Passes: when a satellite crosses the sky over a place
skySvgfunction
A pass drawn on the sky as an SVG string: the horizon as a circle, the zenith (straight overhead) in the middle with rings at 30 and 60 degrees, north up and east on the left (the way a star chart is held over your head), and the satellite's track as a line that is solid and warm where the satellite is in sunlight and dashed where it is in the Earth's shadow, with its start, highest point and end marked. The dome is a dark sky whatever the page's colours; the four directions are written in the page's text colour. It is pure: the same arguments give the same markup.
Import it
import { skySvg } from "@johnmorrisdotca/chikyu-earth/passes";
Definition
function skySvg(pass: SatellitePass, path: readonly PathPoint[], options?: SkyOptions): string
Parameters
| Name | Type | Description |
|---|---|---|
pass | SatellitePass | A pass from |
path | readonly PathPoint[] | Its track from |
options (optional) | SkyOptions | The size, the words and the times to write beside the marks. |
Returns
string
One <svg> element as text.
Examples
import { findPasses, passPath, skySvg } from "@johnmorrisdotca/chikyu-earth/passes";
const iss = {
OBJECT_NAME: "ISS (ZARYA)",
EPOCH: "2026-11-02T10:25:21.580320",
MEAN_MOTION: 15.49150046,
ECCENTRICITY: 0.0007139,
INCLINATION: 51.6332,
RA_OF_ASC_NODE: 335.9757,
ARG_OF_PERICENTER: 339.3739,
MEAN_ANOMALY: 20.6961,
NORAD_CAT_ID: 25544,
BSTAR: 0.00012,
MEAN_MOTION_DOT: 0.0001,
MEAN_MOTION_DDOT: 0,
};
const place = { latitude: 51.5, longitude: -0.13 };
const day = Date.UTC(2026, 10, 3);
const [first] = findPasses(iss, place, { from: day, to: day + 3 * 86_400_000 }, { all: true });
if (first) console.log(skySvg(first, passPath(iss, place, first), { size: 240 }).startsWith("<svg"));trueWhat it prints (run when this page was built)