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

satelliteAxesfunction

The axes of a satellite flying: x along the way it goes (its velocity, taken level with the ground below it), z straight away from the Earth's centre, and y to complete them (z cross x, so it points to the left of the way it goes). The family's convention for a model: its nose or long axis along +x, its top (the side that faces space) along +z.

Import it

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

Definition

function satelliteAxes(position: Vec3, velocity: Vec3): { x: Vec3; y: Vec3; z: Vec3; } | null

Parameters

NameTypeDescription
positionVec3

Where the satellite is, from the Earth's centre, in any unit.

velocityVec3

The way it is going, in any unit.

Returns

{ x: Vec3; y: Vec3; z: Vec3; } | null

Three unit vectors, x, y and z, in the scene's axes; null when the position is the centre or the satellite does not move.

Examples

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

const axes = satelliteAxes([1.066, 0, 0], [0, 0, -7.66]);
console.log(axes?.x, axes?.z);
[ 0, 0, -1 ] [ 1, 0, 0 ]

What it prints (run when this page was built)

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