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 · Satellites: orbital elements in, positions out

Satellitestype

A group of satellites, ready to give positions for any moment: what createSatellites returns, and what <chikyu-space> takes in setSatellites. Positions are in Earth radii (6371 km) from the Earth's centre, in the space view's axes (x to the vernal equinox, y north); a satellite whose elements are older than maxAgeDays at the moment asked about is not placed (its place stays at the centre and visible(index) is false).

Import it

import type { Satellites } from "@johnmorrisdotca/chikyu-earth/satellites";

Definition

interface Satellites {
    readonly count: number;
    readonly sets: readonly ElementSet[];
    readonly refused: readonly RefusedElementSet[];
    readonly maxAgeDays: number;
    readonly propagations: number;
    readonly timing: {
        lastBatchMs: number;
        maxBatchMs: number;
    };
    at(ms: number, out: Float32Array): void;
    visible(index: number): boolean;
    readonly placed: number;
    setStep(ms: number): void;
    exact(index: number, ms: number, out: Float64Array): boolean;
    orbit(index: number, ms: number, points: number): Float32Array;
    info(index: number, ms: number): SatelliteInfo | undefined;
}

Members

NameTypeDescription
countnumber

Satellites that started SGP4.

setsreadonly ElementSet[]

Their elements, in the order of their places.

refusedreadonly RefusedElementSet[]

The ones left out, with the reason.

maxAgeDaysnumber

The oldest an element set may be at the moment shown, in days.

propagationsnumber

SGP4 calls made so far, for a page or a test to count.

timing{ lastBatchMs: number; maxBatchMs: number; }

Milliseconds the last batch of SGP4 took, and the longest so far.

at(ms: number, out: Float32Array): void

Fill out (3 numbers a satellite) with the positions at ms: SGP4 is run for the whole group at two moments step apart and the positions between are interpolated, so a steady clock costs one batch a step and every call in between is arithmetic.

visible(index: number): boolean

True if satellite index was placed by the last at (its elements are not too old at that moment).

placednumber

How many of them the last at placed.

setStep(ms: number): void

The game time between the two moments SGP4 is run at (1000 to 60000 ms); the space view sets it from the clock's speed.

exact(index: number, ms: number, out: Float64Array): boolean

One satellite at exactly ms (no interpolation): position in Earth radii and velocity in km/s into out (6 numbers). False if its elements are too old or SGP4 gave up.

orbit(index: number, ms: number, points: number): Float32Array

The path of satellite index for one revolution from ms, points + 1 points in order along it (the last on the first), into a new array of Earth radii.

info(index: number, ms: number): SatelliteInfo | undefined

Facts about one satellite at ms; undefined if it cannot be placed then.

Examples

import type { Satellites } from "@johnmorrisdotca/chikyu-earth/satellites";

const first = (group: Satellites): string => group.sets[0]?.OBJECT_NAME ?? "none";
console.log(typeof first);
function

What it prints (run when this page was built)

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