Reference · The Sun, Moon and planets: pure parts
Frametype
Where everything is at one moment: positions in astronomical units from the Earth's centre, in scene axes (x to the vernal equinox, y north, z toward -y of the equator).
Import it
import type { Frame } from "@johnmorrisdotca/chikyu-earth/space";
Definition
interface Frame {
ms: number;
sun: Vec3;
moon: Vec3;
planets: Record<PlanetName, Vec3>;
spin: number;
}
Members
| Name | Type | Description |
|---|---|---|
ms | number | |
sun | Vec3 | |
moon | Vec3 | |
planets | Record<"Mercury" | "Venus" | "Mars" | "Jupiter" | "Saturn" | "Uranus" | "Neptune" | "Pluto", Vec3> | |
spin | number | Greenwich sidereal time, in degrees: how far the Earth has turned against the stars. |
Examples
import { frameAt, type Frame } from "@johnmorrisdotca/chikyu-earth/space";
const frame: Frame = frameAt(Date.UTC(2026, 10, 2, 12));
console.log(Object.keys(frame.planets).length, frame.spin.toFixed(0));8 222What it prints (run when this page was built)