リファレンス · 場所から見た太陽と月: 位置、日の出と日の入り、月の出入りと月相。suncalc 2 と同じ名前で、より正確です
getPosition関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The Sun's place in the sky from a place on the Earth.
インポート
import { getPosition } from "@johnmorrisdotca/wakusei-planets/suncalc";
定義
function getPosition(date: Date | number, lat: number, lng: number): Position
引数
| 名前 | 型 | 説明 |
|---|---|---|
date | number | Date | The moment, as a |
lat | number | Degrees north, -90 to 90. |
lng | number | Degrees east (west negative). |
戻り値
Position
The azimuth (degrees clockwise from north) and the apparent altitude (degrees).
例
import { getPosition } from "@johnmorrisdotca/wakusei-planets/suncalc";
const { azimuth, altitude } = getPosition(new Date(Date.UTC(2026, 5, 21, 12)), 51.5, -0.1);
console.log(azimuth.toFixed(0), altitude.toFixed(0));179 62出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。