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

aboveModelSharefunction

The share of the view's height that a model's radius takes when the camera is distanceKm above the satellite (a ride above it). A satellite is a few metres across, so the model is drawn larger than it is, but a model that stays a share of the picture at any height becomes a block thousands of kilometres across from far up. So the model keeps a fixed size in the world, about 16 km in radius, which is the share ABOVE_MODEL_SHARE at ABOVE_MODEL_KM: it is never larger than that, falls as one over the height above it, and from MODEL_FADE_FROM_KM is let down smoothly (a smooth step) to nothing at MODEL_FADE_TO_KM, where the satellite is its ordinary mark. Pure, so a test can ask it at any height.

Import it

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

Definition

function aboveModelShare(distanceKm: number, lowest?: number): number

Parameters

NameTypeDescription
distanceKmnumber

The camera's distance from the satellite, in kilometres.

lowest (optional)number

The share at the lowest height, ABOVE_MODEL_SHARE by default (a page sets it with ride-model-share).

Returns

number

The share, from 0 to 0.17.

Examples

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

console.log(aboveModelShare(150), aboveModelShare(1000) < aboveModelShare(150), aboveModelShare(6000));
0.17 true 0

What it prints (run when this page was built)

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