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
| Name | Type | Description |
|---|---|---|
position | Vec3 | The satellite's place from the Earth's centre. |
velocity | Vec3 | Its velocity. |
yaw | number | The turn of the picture about the satellite, in radians. |
tilt | number | 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)