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

aboveAxesfunction

The camera of the view above a satellite: where it stands from the satellite (a unit vector, to be multiplied by the height) and the way its picture's top points. With no turn and no tip the camera is straight above the satellite, looking straight down at it, the way the satellite is going at the top of the picture. yaw turns the picture about the satellite (the top points the other way round the satellite); tilt tips the camera back (positive) or ahead of the satellite (negative), so it looks down at it from behind or in front.

Import it

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

Definition

function aboveAxes(position: Vec3, velocity: Vec3, yaw: number, tilt: number): { offset: Vec3; up: Vec3; }

Parameters

NameTypeDescription
positionVec3

The satellite's place from the Earth's centre.

velocityVec3

Its velocity.

yawnumber

The turn of the picture about the satellite, in radians.

tiltnumber

How far the camera is tipped back from straight above, in radians.

Returns

{ offset: Vec3; up: Vec3; }

The unit offset of the camera from the satellite, and the unit vector at the top of its picture.

Examples

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

const view = aboveAxes([1.07, 0, 0], [0, 0, 1], 0, 0);
console.log(view.offset, view.up);
[ 1, 0, 0 ] [ 0, 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.