Skip to the content

Chikyu Earth地球

A line-drawn globe of the world's countries that turns at the Earth's own rate, with an optional realistic Earth from space and markers for any place.

Chikyu is the Japanese word 地球 for the Earth. About the name

Contents

Reference · The data door: hand the package your own maps of the Earth or orbit data as a source with its own licence and credit, and see whose data is on the screen

wrapLonfunction

Fold a longitude into the half-open range from -180 up to, but not including, 180. 180 and -180 are the same meridian, and both come back as -180.

Import it

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

Definition

function wrapLon(lon: number): number

Parameters

NameTypeDescription
lonnumber

A longitude in degrees, which may fall outside one turn.

Returns

number

The longitude in [-180, 180).

Examples

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

console.log(wrapLon(180), wrapLon(-180), wrapLon(190));
-180 -180 -170

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/chikyu-earth 0.51.1.