本文へ移動

Chikyu Earth地球

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

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

目次

リファレンス · SVG文字列としての地球儀

routeLeg関数

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

Distance, bearings, midpoint and a flight-time estimate between two places. The distance quoted is the WGS84 geodesic. The flight time is that distance at FLIGHT_SPEED_KM_H, an estimate with no wind.

インポート

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

定義

function routeLeg(from: GeoPoint, to: GeoPoint): RouteLeg | null

引数

名前型説明
fromGeoPoint

The start, degrees.

toGeoPoint

The end, degrees.

戻り値

RouteLeg | null

The leg, or null when a place is not on the Earth.

例

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

const leg = routeLeg({ lon: 0, lat: 0 }, { lon: 1, lat: 0 });
console.log(leg?.kilometres.toFixed(3), leg?.initialBearing);
111.319 90

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

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

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