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 Sun, Moon and planets: pure parts

createTrackfunction

Answers for any moment from two real ones: at(ms) asks astronomy-engine only when ms leaves the span the last two answers cover, and then looks stepMs ahead, so playing time at a steady rate costs one pair of lookups every stepMs and every draw in between is arithmetic.

Import it

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

Definition

function createTrack(initialStepMs?: number): { at(ms: number): Frame; ends(): [Frame, Frame] | undefined; readonly lookups: number; reset(): void; setStep(ms: number): void; }

Parameters

NameTypeDescription
initialStepMs (optional)number

How far ahead the second answer looks, in milliseconds.

Returns

{ at(ms: number): Frame; ends(): [Frame, Frame] | undefined; readonly lookups: number; reset(): void; setStep(ms: number): void; }

A track: at(ms) for a frame, lookups for how many times the ephemeris was asked, ends() for the two answers it is between (undefined before the first at), reset() and setStep(ms).

Examples

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

const track = createTrack(1000);
const start = Date.UTC(2026, 10, 2);
for (let step = 0; step < 10; step += 1) track.at(start + step * 50);
console.log(track.lookups);
2

What it prints (run when this page was built)

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