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
引数
| 名前 | 型 | 説明 |
|---|---|---|
from | GeoPoint | The start, degrees. |
to | GeoPoint | 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出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。