Reference · Where the Sun, Moon and planets are for a date, in two scales, with the camera maths
planetOrbitfunction
The path a planet takes round the Sun, as count + 1 points round one trip from where the planet is at ms, from the Sun, in astronomical units and the scene's axes.
Import it
import { planetOrbit } from "@johnmorrisdotca/wakusei-planets/space";
Definition
function planetOrbit(id: SpacePlanet, ms: number, count?: number): Vec3[]
Parameters
| Name | Type | Description |
|---|---|---|
id | "mercury" | "venus" | "mars" | "jupiter" | "saturn" | "uranus" | "neptune" | "pluto" | The planet. |
ms | number | The moment the path starts at, in milliseconds since the Unix epoch. |
count (optional) | number | How many segments to cut the trip into. |
Returns
Vec3[]
count + 1 points; the last is near the first.
Examples
import { planetOrbit } from "@johnmorrisdotca/wakusei-planets/space";
const points = planetOrbit("jupiter", Date.UTC(2026, 10, 2), 12);
console.log(points.length);13What it prints (run when this page was built)