Reference · Bodies as objects for your own three.js scene
orientationfunction
The north pole and the prime meridian of a body at a time, as unit vectors in the scene's axes (x to the vernal equinox, y north). A moon that keeps one face to its planet is given the direction to the planet as its meridian, so its near side faces the planet.
Import it
import { orientation } from "@johnmorrisdotca/wakusei-planets/painter";
Definition
function orientation(id: BodyId, ms: number): { pole: Vec3; meridian: Vec3; }
Parameters
| Name | Type | Description |
|---|---|---|
id | BodyId | The body's name. |
ms | number | The instant, in milliseconds since 1970. |
Returns
{ pole: Vec3; meridian: Vec3; }
The pole and the direction of longitude 0, both unit vectors.
Examples
import { orientation } from "@johnmorrisdotca/wakusei-planets/painter";
const { pole } = orientation("mars", Date.UTC(2026, 10, 2));
console.log(pole.map((n) => n.toFixed(2)).join(", "));0.45, 0.80, 0.41What it prints (run when this page was built)