本文へ移動

Wakusei Planets惑星

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

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

目次

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

within関数

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

Every body inside a radius of a body on a date, nearest first: nearest with no limit on how many. The radius is degrees for by: "sky" and kilometres for by: "space".

インポート

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

定義

function within(target: BodyId, radius: number, options: Omit<NearestOptions, "count" | "within"> & { by: "space"; }): SpaceNeighbour[]
function within(target: BodyId, radius: number, options?: Omit<NearestOptions, "count" | "within"> & { by?: "sky"; }): SkyNeighbour[]
function within(target: BodyId, radius: number, options: Omit<NearestOptions, "count" | "within">): SkyNeighbour[] | SpaceNeighbour[]

引数

名前型説明
targetBodyId

The body to look around.

radiusnumber

How close, in degrees (the sky) or kilometres (space).

optionsOmit<NearestOptions, "count" | "within">

The same as nearest, without count and within.

戻り値

SpaceNeighbour[] | SkyNeighbour[]

The bodies inside the radius, nearest first.

例

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

const date = Date.UTC(2023, 2, 2, 0);
console.log(within("venus", 1, { date }).map((row) => `${row.id} ${row.angle.toFixed(2)}`).join(", "));
console.log(within("jupiter", 1_000_000, { by: "space", kind: "moon", date }).map((row) => row.id).join(", "));
europa 0.53, jupiter 0.53, io 0.55, ganymede 0.55, callisto 0.58
io, europa

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

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

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