本文へ移動

Chikyu Earth地球

世界の国の輪郭を線で描いた地球儀です。地球と同じ速さで回ります。宇宙から見たような地球と、好きな場所の目印も使えます。

「地球」(ちきゅう) は、私たちが住む星の名前です。 名前について(英語)

目次

リファレンス · 太陽、月、惑星: 計算部分

satelliteAxes関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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 { satelliteAxes } from "@johnmorrisdotca/chikyu-earth/space";

定義

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

引数

名前型説明
positionVec3

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

velocityVec3

The way it is going, in any unit.

戻り値

{ 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.

例

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 ]

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/chikyu-earth 0.51.1 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。