本文へ移動

Wakusei Planets惑星

太陽・惑星・衛星を、線画、陰影つきの絵、表面の地図で描きます。実際の大きさ・傾き・自転つきで、任意の日時の衛星の位置も分かります。

「惑星」(わくせい) は、太陽のまわりを回る大きな星のことです。 名前について(英語)

目次

リファレンス · 日付ごとの太陽・月・惑星の位置を、二つの縮尺で。カメラの計算つき

ridePose関数

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

The camera of a body-borne view: at position, looking at the body it goes round (a Moon over the Earth, a moon over Jupiter, a spacecraft over Mars: any centre, by radius), with the way it is going at the top of the picture. look: "horizon" tips it forward until the horizon is a little above the middle. A drag looks about from there, as a head on a pivot does: yaw turns the camera to its left and tilt tips it towards the bottom of its picture, so the ground follows the pointer (right for a drag right, up for a drag up); the angle for each pixel of the drag is the field of view's, so the pace is the same at any zoom. zoom narrows the field of view.

インポート

import { ridePose } from "@johnmorrisdotca/wakusei-planets/space";

定義

function ridePose(input: RideInput): RidePose

引数

名前型説明
inputRideInput

The camera's place, its way of travel, the radius of what it goes round, the look, and the shared controls' yaw, tilt and zoom.

戻り値

RidePose

The camera's place, forward and up directions (unit vectors), its field of view, and the body's angular radius from there.

例

import { ridePose } from "@johnmorrisdotca/wakusei-planets/space";

const pose = ridePose({ position: [1.066, 0, 0], velocity: [0, 0, -7.66], radius: 1, look: "down", yaw: 0, tilt: 0, zoom: 1 });
console.log(pose.forward.map((n) => n.toFixed(2)).join(","), pose.bodyRadiusDegrees.toFixed(0));
-1.00,0.00,0.00 70

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

ソースを見るGitHub で編集@johnmorrisdotca/wakusei-planets 0.24.0 のソースから作成しました。

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