Reference · The Sun, Moon and planets: pure parts
orbitPathfunction
The path a planet takes round the Sun, as count points around the orbit that starts where the planet is at ms, relative to the Sun (scene axes, AU).
Import it
import { orbitPath } from "@johnmorrisdotca/chikyu-earth/space";
Definition
function orbitPath(name: PlanetName, ms: number, count?: number): Vec3[]
Parameters
| Name | Type | Description |
|---|---|---|
name | "Mercury" | "Venus" | "Mars" | "Jupiter" | "Saturn" | "Uranus" | "Neptune" | "Pluto" | The planet. |
ms | number | The moment the orbit starts at, in milliseconds since the Unix epoch. |
count (optional) | number | How many segments to cut the orbit into. |
Returns
Vec3[]
count + 1 points, the last on the first.
Examples
import { orbitPath } from "@johnmorrisdotca/chikyu-earth/space";
const points = orbitPath("Jupiter", Date.UTC(2026, 10, 2), 12);
console.log(points.length);13What it prints (run when this page was built)