Skip to the content

Chizu地図

Draw SVG maps, frame regions, place numbered callouts and build geography quizzes with English and Japanese names.

Chizu is the Japanese word 地図 for map. About the name

Contents

Reference · Framing, geometry and quiz tools

groundDistancefunction

How far, in metres, two places are from each other, along the ground: the local projection centred half way between them, so within a hair of the ellipsoid up to 400 km. Past 400 km it falls back to the great circle on the mean sphere, which is within 0.5% of the ellipsoid's.

Import it

import { groundDistance } from "@johnmorrisdotca/chizu";

Definition

function groundDistance(a: readonly [number, number], b: readonly [number, number]): number

Parameters

NameTypeDescription
areadonly [number, number]

The first place, as [longitude, latitude] in degrees.

breadonly [number, number]

The second place, as [longitude, latitude] in degrees.

Returns

number

The distance along the ground, in metres.

Examples

import { groundDistance } from "@johnmorrisdotca/chizu";

// Tokyo Station to Shinjuku Station, about 6.1 km.
console.log(Math.round(groundDistance([139.7671, 35.6812], [139.7006, 35.6896]) / 100) / 10);
// 6.1
6.1

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/chizu 1.5.0.