dayNightViewfunction
The turn of the globe on the day and night sheet for a moment: the Sun's longitude less 90 degrees at the middle, so the lit half is on the right, tipped to show the north.
Import it
import { dayNightView } from "@johnmorrisdotca/chikyu-earth/sheets";
Definition
function dayNightView(ms: number): { centre: [number, number]; sun: { lon: number; lat: number; }; roll: number; }
Parameters
| Name | Type | Description |
|---|---|---|
ms | number | The moment, in milliseconds since the Unix epoch. |
Returns
{ centre: [number, number]; sun: { lon: number; lat: number; }; roll: number; }
The place at the middle of the globe, the place where the Sun is straight overhead and the roll of the globe about the line of sight, in degrees.
Examples
import { dayNightView } from "@johnmorrisdotca/chikyu-earth/sheets";
const view = dayNightView(Date.UTC(2026, 5, 21, 12));
console.log(view.sun.lat.toFixed(1));23.4What it prints (run when this page was built)