本文へ移動

Wakusei Planets惑星

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

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

目次

リファレンス · ある日付に、ある天体にいちばん近い天体を、空の見かけの角度か宇宙での距離でさがします。2つの天体がいちばん近づく時刻も: nearest、within、closestApproach、conjunctions

nearest関数

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

The bodies nearest to a body on a date, nearest first: by the angle between them in the sky of an observer, or by the distance between them in space. The Sun, the planets, the dwarf planets and the moons are searched; the target itself, and the body the sky is seen from, are not in the answer.

A sky angle is astrometric: the observer's place at the date, each body where it was when its light left (a second and a half for the Moon, hours for Neptune), with no aberration or light bending. It is the angle between two centres, found with an arc tangent so that it is as exact near 0 and 180 degrees as at 90. A distance is the straight line between the two centres at that instant, with no light time. Every result carries the accuracy to expect from the theories (the accuracy guide's limits, combined).

インポート

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

定義

function nearest(target: BodyId, options: NearestOptions & { by: "space"; }): SpaceNeighbour[]
function nearest(target: BodyId, options?: NearestOptions & { by?: "sky"; }): SkyNeighbour[]
function nearest(target: BodyId, options: NearestOptions): SkyNeighbour[] | SpaceNeighbour[]

引数

名前型説明
targetBodyId

The body to look around.

optionsNearestOptions

count (default 5; all inside within when that is given), within (degrees for by: "sky", kilometres for by: "space"), kind, bodies (search only these), by, date (default now) and observer (default the Earth's centre).

戻り値

SpaceNeighbour[] | SkyNeighbour[]

The bodies, nearest first, as { id, kind, angle, uncertaintyArcseconds } for the sky and { id, kind, distanceKm, distanceAu, uncertaintyKm } for space.

例

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

const date = Date.UTC(2020, 11, 21, 18);
console.log(nearest("jupiter", { count: 2, kind: "planet", date }).map((row) => `${row.id} ${row.angle.toFixed(2)}`).join(", "));
console.log(nearest("earth", { by: "space", kind: "planet", count: 2, date }).map((row) => `${row.id} ${row.distanceAu.toFixed(2)} au`).join(", "));
saturn 0.10, mercury 29.25
mars 0.81 au, mercury 1.44 au

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

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

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