Reference · Passes: when a satellite crosses the sky over a place
sunAltitudefunction
The Sun's altitude over a place at a moment, in degrees (above 0 the Sun is up). It uses the package's own low-precision Sun, good to about 0.02 degree, and does not add refraction.
Import it
import { sunAltitude } from "@johnmorrisdotca/chikyu-earth/passes";
Definition
function sunAltitude(ms: number, observer: Observer): number
Parameters
| Name | Type | Description |
|---|---|---|
ms | number | A moment, in milliseconds since the Unix epoch. |
observer | Observer | Where the watcher stands. |
Returns
number
The altitude of the Sun's centre, in degrees.
Examples
import { sunAltitude } from "@johnmorrisdotca/chikyu-earth/passes";
// Tokyo at 9 in the evening local time (12:00 UTC) on 9 November 2026
console.log(sunAltitude(Date.UTC(2026, 10, 9, 12), { latitude: 35.68, longitude: 139.69 }).toFixed(0));-53What it prints (run when this page was built)