Reference · The same, with suncalc 1's conventions (radians, azimuth from south)
getPositionfunction
The Sun's place in the sky, as suncalc 1 gave it: the altitude has no refraction in it.
Import it
import { getPosition } from "@johnmorrisdotca/wakusei-planets/suncalc/legacy";
Definition
function getPosition(date: Date | number, lat: number, lng: number): LegacyPosition
Parameters
| Name | Type | Description |
|---|---|---|
date | number | Date | The moment. |
lat | number | Degrees north. |
lng | number | Degrees east. |
Returns
LegacyPosition
The azimuth in radians from south toward west and the altitude in radians.
Examples
import { getPosition } from "@johnmorrisdotca/wakusei-planets/suncalc/legacy";
const { altitude } = getPosition(new Date(Date.UTC(2026, 5, 21, 12)), 51.5, -0.1);
console.log((altitude * 180 / Math.PI).toFixed(0));62What it prints (run when this page was built)