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[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
target | BodyId | The body to look around. |
radius | number | How close, in degrees (the sky) or kilometres (space). |
options | Omit<NearestOptions, "count" | "within"> | The same as |
戻り値
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出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。