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 · /meteors

darknessfunction

How dark the sky is at a place, from 0 (the Sun is up) to 1 (the Sun is 6 degrees or more below the horizon, the end of civil twilight), rising evenly between: meteors are counted as seen only where it is dark.

Import it

import { darkness } from "@johnmorrisdotca/chikyu-earth/meteors";

Definition

function darkness(place: readonly [number, number, number], sun: readonly [number, number, number]): number

Parameters

NameTypeDescription
placereadonly [number, number, number]

The place's unit vector (placeVector).

sunreadonly [number, number, number]

The unit vector of the place the Sun is overhead.

Returns

number

0 to 1.

Examples

import { darkness, placeVector } from "@johnmorrisdotca/chikyu-earth/meteors";

const sun = placeVector({ lon: 0, lat: 0 });
console.log(darkness(placeVector({ lon: 0, lat: 0 }), sun), darkness(placeVector({ lon: 180, lat: 0 }), sun)); // 0 1
0 1

What it prints (run when this page was built)

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