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 globe as an SVG string

rotationAtfunction

The rotation at now for a globe that was centred on centre at start. The tilt stays; the spin advances at the Earth's own rate, so the disc turns as the real Earth does and the centred place drifts with it.

Import it

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

Definition

function rotationAt(centre: GeoPoint, now: number, start: number): Rotation

Parameters

NameTypeDescription
centreGeoPoint

The place the globe was centred on at start.

nownumber

The time to draw for, in milliseconds.

startnumber

The time the globe was centred, in the same milliseconds as now.

Returns

Rotation

The [lambda, phi] rotation at now.

Examples

import { rotationAt, SIDEREAL_DAY_MS } from "@johnmorrisdotca/chikyu-earth";

const tokyo = { lon: 139.7, lat: 35.7 };
console.log(rotationAt(tokyo, SIDEREAL_DAY_MS / 2, 0));
[ 40.30000000000001, -35.7 ]

What it prints (run when this page was built)

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