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 realistic Earth's pure parts

discRadiusfunction

The disc's radius in CSS pixels in a box of width x height at zoom: it fits the glow in the box at 1x.

Import it

import { discRadius } from "@johnmorrisdotca/chikyu-earth/realistic";

Definition

function discRadius(width: number, height: number, zoom: number): number

Parameters

NameTypeDescription
widthnumber

The box's width in CSS pixels.

heightnumber

The box's height in CSS pixels.

zoomnumber

The view's zoom, 1 at Fit.

Returns

number

The radius in CSS pixels, at least 1.

Examples

import { discRadius } from "@johnmorrisdotca/chikyu-earth/realistic";

console.log(discRadius(400, 400, 1).toFixed(1));
184.2

What it prints (run when this page was built)

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