本文へ移動

Chikyu Earth地球

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

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

目次

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

modelRadius関数

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

The radius to draw a model at so that it is share of the height of the view across its radius, seen from away with the half field of view half (the tangent of half the field, as the view uses it): the model grows with the distance, so it reads at any distance the camera keeps. Never under real, its true size, so a camera that comes in close still sees it as big as it is.

インポート

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

定義

function modelRadius(away: number, half: number, share: number, real: number): number

引数

名前型説明
awaynumber

The camera's distance from the satellite, in the scene's units.

halfnumber

The tangent of half the field of view.

sharenumber

The share of the view's height that the radius should take (MODEL_RADIUS_SHARE).

realnumber

The model's true radius, in the same units.

戻り値

number

The radius to draw it at.

例

import { MODEL_RADIUS_SHARE, modelRadius } from "@johnmorrisdotca/chikyu-earth/space";

console.log(modelRadius(0.5, Math.tan((35 / 2) * (Math.PI / 180)), MODEL_RADIUS_SHARE, 1e-8));
0.0536007941094272

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

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

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