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

unitVectorfunction

A point on the globe as a unit vector: +z is longitude 0 on the equator, +x east, +y north.

Import it

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

Definition

function unitVector(point: GeoPoint): [number, number, number]

Parameters

NameTypeDescription
pointGeoPoint

A longitude and latitude in degrees.

Returns

[number, number, number]

The [x, y, z] of the point on a sphere of radius 1.

Examples

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

console.log(unitVector({ lon: 90, lat: 0 }).map((n) => Math.round(n)));
[ 1, 0, 0 ]

What it prints (run when this page was built)

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