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

streakPathfunction

Where one streak runs: from start to end, in Earth radii from the centre, in the Earth's own axes. It ends METEOR_HEIGHT_KM.bottom + 5 km up and comes down the line from the radiant; its true length is the drop in height divided by the sine of the radiant's height, at most 260 km, and stretch (1 or more) lengthens it for the eye.

Import it

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

Definition

function streakPath(place: readonly [number, number, number], radiant: readonly [number, number, number], stretch?: number): { start: Vec3; end: Vec3; km: number; }

Parameters

NameTypeDescription
placereadonly [number, number, number]

The unit vector of the place it ends over.

radiantreadonly [number, number, number]

The unit vector towards the radiant (it must stand above that place's horizon).

stretch (optional)number

How many times longer than true to draw it; 1 is true.

Returns

{ start: Vec3; end: Vec3; km: number; }

The two ends, and the true length in kilometres.

Examples

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

const place = placeVector({ lon: 0, lat: 0 });
// Straight down from overhead: it falls 25 km, from 110 km up to 85 km.
const path = streakPath(place, place, 1);
console.log(path.km.toFixed(0), ((Math.hypot(...path.start) - 1) * 6371).toFixed(0)); // "25" "110"
25 110

What it prints (run when this page was built)

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