本文へ移動

Chikyu Earth地球

世界の国の輪郭を線で描いた地球儀です。地球と同じ速さで回ります。宇宙から見たような地球と、好きな場所の目印も使えます。

「地球」(ちきゅう) は、私たちが住む星の名前です。 名前について(英語)

目次

リファレンス · 地点の場所: 国、海、大陸、最も近い都市

alongTrack関数

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

The ordered changes of place along a ground track. Each point is { lon, lat, t }. A change is reported at the sample that entered the new place. near is how a page says the track is approaching a country; the next sample inside it is the country itself.

インポート

import { alongTrack } from "@johnmorrisdotca/chikyu-earth/place";

定義

function alongTrack(points: readonly { lon: number; lat: number; t: number; }[], options?: PlaceOptions): TrackChange[]

引数

名前型説明
pointsreadonly { lon: number; lat: number; t: number; }[]

The track, in order. A point with no latitude is skipped.

options (省略可)PlaceOptions | undefined

The same city lists as placeOf. They do not change the country or the sea.

戻り値

TrackChange[]

One row for the first sample, then one row each time the country, the nearby country or the sea changes.

例

import { alongTrack } from "@johnmorrisdotca/chikyu-earth/place";

const rows = alongTrack([
  { lon: -40, lat: 40, t: 0 },
  { lon: -3.7, lat: 40.4, t: 1 },
  { lon: 2.35, lat: 48.86, t: 2 },
]);
console.log(rows.map((row) => row.entering?.id).join(" "));
atlantic-ocean ES FR

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

ソースを見るGitHub で編集@johnmorrisdotca/chikyu-earth 0.51.1 のソースから作成しました。

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