Skip to the content

Wakusei Planets惑星

The Sun, the planets and their moons as a clean line drawing, a shaded realistic drawing or a painted surface map, with real sizes, tilt and rotation, and the moons where they are at any date and time.

Wakusei is the Japanese word 惑星 for a planet. About the name

Contents

Reference · The Sun and Moon from a place: position, sunrise and sunset, Moon rise, set and phase, with suncalc 2's names and a better engine

getMoonPositionfunction

The Moon's place in the sky from a place on the Earth.

Import it

import { getMoonPosition } from "@johnmorrisdotca/wakusei-planets/suncalc";

Definition

function getMoonPosition(date: Date | number, lat: number, lng: number): MoonPosition

Parameters

NameTypeDescription
datenumber | Date

The moment, as a Date (or milliseconds since 1970).

latnumber

Degrees north, -90 to 90.

lngnumber

Degrees east (west negative).

Returns

MoonPosition

The azimuth (degrees clockwise from north), apparent altitude (degrees), distance from the Earth's centre (kilometres) and parallactic angle (degrees).

Examples

import { getMoonPosition } from "@johnmorrisdotca/wakusei-planets/suncalc";

const { distance } = getMoonPosition(new Date(Date.UTC(2026, 10, 7, 12)), 35.7, 139.7);
console.log(Math.round(distance / 1000));
392

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/wakusei-planets 0.24.0.