Reference · The globe as an SVG string
greatCircleKmfunction
The great-circle distance, kilometres, on a sphere of MEAN_RADIUS_KM. The same angle trackSteps uses between two unit vectors.
Import it
import { greatCircleKm } from "@johnmorrisdotca/chikyu-earth";
Definition
function greatCircleKm(from: GeoPoint, to: GeoPoint): number | null
Parameters
| Name | Type | Description |
|---|---|---|
from | GeoPoint | The start, degrees. |
to | GeoPoint | The end, degrees. |
Returns
number | null
The distance, or null when a place is not on the Earth.
Examples
import { greatCircleKm } from "@johnmorrisdotca/chikyu-earth";
console.log(greatCircleKm({ lon: 0, lat: 0 }, { lon: 0, lat: 0 }));0What it prints (run when this page was built)