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

fitDistancefunction

The camera's distance, in radii of the body it looks at, at which the body's disc fills size of the view's shorter side (aspect is the view's width over its height; the field of view is vertical). Pure; size may be above 1 for a body drawn larger than the view.

Import it

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

Definition

function fitDistance(size: number, aspect: number): number

Parameters

NameTypeDescription
sizenumber

Share of the shorter side the disc's diameter fills.

aspectnumber

Width over height of the view.

Returns

number

The distance, in the body's radii.

Examples

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

console.log(fitDistance(0.9, 16 / 9).toFixed(2));
3.66

What it prints (run when this page was built)

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