Skip to the content

Kuni国

Look up countries, codes, names and subdivisions, load country data on demand and mount a native country card.

Kuni (国) is Japanese for a country. About the name

Contents

Reference · Country facts

distanceKmfunction

The great-circle distance between two points, in kilometres, on a sphere of the earth's mean radius (6,371 km). Within about half a percent of the distance on the ground.

Import it

import { distanceKm } from "@johnmorrisdotca/kuni/facts";

Definition

function distanceKm(from: LatLon, to: LatLon): number

Parameters

NameTypeDescription
fromLatLon

A point, { lat, lon } in degrees.

toLatLon

Another point.

Returns

number

The distance in kilometres.

Examples

import { distanceKm, facts } from "@johnmorrisdotca/kuni/facts";

console.log(Math.round(distanceKm(facts("JP")!.capitalPoint!, facts("GB")!.capitalPoint!))); // 9558
9558

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kuni 1.4.0.