本文へ移動

Wakusei Planets惑星

太陽・惑星・衛星を、線画、陰影つきの絵、表面の地図で描きます。実際の大きさ・傾き・自転つきで、任意の日時の衛星の位置も分かります。

「惑星」(わくせい) は、太陽のまわりを回る大きな星のことです。 名前について(英語)

目次

リファレンス · 同じものを suncalc 1 の約束 (ラジアン、南からの方位) で

getMoonTimes関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The Moon's rise and set over the 24 hours from midnight of the moment's day, in the machine's zone or, with inUTC, in UTC.

インポート

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

定義

function getMoonTimes(date: Date | number, lat: number, lng: number, inUTC?: boolean): LegacyMoonTimes

引数

名前型説明
datenumber | Date

Any moment of the day.

latnumber

Degrees north.

lngnumber

Degrees east.

inUTC (省略可)boolean

Search the UTC day instead of the local one.

戻り値

LegacyMoonTimes

rise and set when they happen, and alwaysUp or alwaysDown when the Moon stays up or down.

例

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

const t = getMoonTimes(new Date(Date.UTC(2026, 10, 7, 12)), 35.7, 139.7, true);
console.log(t.rise === undefined || t.rise instanceof Date);
true

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/wakusei-planets 0.24.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。