本文へ移動

Chikyu Earth地球

世界の国の輪郭を線で描いた地球儀です。地球と同じ速さで回ります。宇宙から見たような地球と、好きな場所の目印も使えます。

「地球」(ちきゅう) は、私たちが住む星の名前です。 名前について(英語)

目次

リファレンス · 太陽、月、惑星: 計算部分

SatelliteScreen型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

Where a satellite is on the screen now: in CSS pixels from the view's top left (which may lie outside the box), whether it can be seen, which edge it lies beyond, whether it is behind the camera, whether the Earth hides it, and how high it is.

インポート

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

定義

interface SatelliteScreen {
    x: number;
    y: number;
    visible: boolean;
    heightKm: number;
    edge: ScreenEdge | null;
    behind: boolean;
    occluded: boolean;
    estimated: boolean;
}

メンバー

名前型説明
xnumber
ynumber
visibleboolean

Inside the box, in front of the camera and not hidden by the Earth.

heightKmnumber

Height above the mean Earth radius, in kilometres, at the moment drawn.

edgeScreenEdge | null

The edge the satellite lies beyond, or null when its place is inside the box. Behind the camera, the edge is the way it lies in the camera's own axes, not the mirrored picture.

behindboolean

The satellite is behind the camera. The picture would put it on the opposite side, so edge is taken from the camera's own axes.

occludedboolean

The Earth hides the satellite: the line from the camera meets the globe before the satellite. False at the limb, in front, and when the satellite is only behind the camera.

estimatedboolean

Its place is an estimate (estimate-far): the moment shown is beyond maxAgeDays from its elements.

例

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

const seen = (place: SatelliteScreen | null): boolean => place !== null && place.visible;
console.log(typeof seen);
function

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/chikyu-earth 0.51.1 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。