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
引数
| 名前 | 型 | 説明 |
|---|---|---|
position | Vec3 | Where the satellite is, from the Earth's centre, in any unit. |
velocity | Vec3 | 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 ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。