Reference · Facts, line drawings and positions
heliocentricfunction
A planet's or dwarf planet's position in the Sun's frame (J2000 ecliptic, astronomical units) at a time: Mercury to Neptune from the VSOP87B series, and Pluto and the other dwarf planets from tables fitted to Horizons (each within a few arc-seconds or better, see the accuracy guide; outside a table's years a dwarf planet falls back to the osculating elements of one epoch from JPL's Small-Body Database).
Import it
import { heliocentric } from "@johnmorrisdotca/wakusei-planets";
Definition
function heliocentric(planet: HostId, ms: number): Vec3
Parameters
| Name | Type | Description |
|---|---|---|
planet | HostId | The planet's or dwarf planet's name. |
ms | number | The instant, in milliseconds since 1970 (UTC). |
Returns
Vec3
The position as x, y, z in au.
Examples
import { heliocentric } from "@johnmorrisdotca/wakusei-planets";
const [x, y, z] = heliocentric("earth", Date.UTC(2026, 0, 3));
console.log(Math.hypot(x, y, z).toFixed(3));0.983What it prints (run when this page was built)