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

rideTiltLimitsfunction

The range of the controls' tilt that does something in the horizon look: from straight down to a little above the horizon. A tilt beyond it moves nothing, so a page holds the tilt to it, and a drag back starts moving at once instead of after the excess is dragged back. It depends on the height (the horizon is further from straight down the higher the camera is) and the zoom. The down look has no such range.

Import it

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

Definition

function rideTiltLimits(distance: number, look: RideLook, zoom: number): { min: number; max: number; } | null

Parameters

NameTypeDescription
distancenumber

The camera's distance from the Earth's centre, in Earth radii.

lookRideLook

The look.

zoomnumber

The shared controls' zoom.

Returns

{ min: number; max: number; } | null

The lowest and highest tilt, or null for the down look.

Examples

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

const range = rideTiltLimits(1.066, "horizon", 1);
console.log(range && `${range.min.toFixed(0)} to ${range.max.toFixed(0)}`, rideTiltLimits(1.066, "down", 1));
-35 to 38 null

What it prints (run when this page was built)

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