リファレンス · 自分の three.js シーンに置く天体
moonOffset関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Where a moon is from its planet's centre, in planet radii, in the scene's axes (x to the vernal equinox, y north).
インポート
import { moonOffset } from "@johnmorrisdotca/wakusei-planets/painter";
定義
function moonOffset(id: MoonId, ms: number): Vec3
引数
| 名前 | 型 | 説明 |
|---|---|---|
id | "moon" | "phobos" | "deimos" | "io" | "europa" | "ganymede" | "callisto" | "mimas" | "enceladus" | "tethys" | "dione" | "rhea" | "titan" | "iapetus" | "miranda" | "ariel" | "umbriel" | "titania" | "oberon" | "proteus" | "triton" | "nereid" | "charon" | "nix" | "hydra" | "vanth" | "hiiaka" | "namaka" | "dysnomia" | The moon's name. |
ms | number | The instant, in milliseconds since 1970. |
戻り値
Vec3
The offset, in radii of the planet the moon goes round.
例
import { moonOffset } from "@johnmorrisdotca/wakusei-planets/painter";
const [x, y, z] = moonOffset("io", Date.UTC(2026, 10, 2));
console.log(Math.hypot(x, y, z).toFixed(1));5.9出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。