Documentation / @interstellar-tools/equations / bodyOrientation
Function: bodyOrientation()
ts
function bodyOrientation(
model: IauRotationModelInterface,
date: Date
): BodyOrientationInterface;Defined in: cartography/body-orientation.ts:110
The orientation of a body at a moment, from its IAU rotation model, as rotation.iau in @interstellar-tools/constants gives it: where its pole points, how far it has turned, and the rotation into its body-fixed frame.
With
and the matrix is bodyFixedFromInertialDcmIAU of those angles,
Notes
- The pole is the model's: the IAU's
'north'pole for the planets and their moons, on the north side of the solar system's invariable plane, and the'positive'one, by the right-hand rule, for dwarf planets and asteroids. For Venus, Uranus, Uranus's moons and Triton,decreases. - The date is turned into TDB with julianDate, so it must be on or after 1972-01-01.
- It matches NASA NAIF's SPICE, with
pck00011.tpc, to: SPICE's IAU_<body>frames are these models. - The IAU gives these models to about 0.1°, and Earth's to 150″ or worse: use the IERS's Earth rotation angle for Earth.
Parameters
| Parameter | Type | Description |
|---|---|---|
model | IauRotationModelInterface | The body's IAU rotation model, for example body.rotation.iau from a dataset. |
date | Date | The moment, as a UTC Date, on or after 1972-01-01. |
Returns
The pole, the prime meridian's angle, and the ICRF → body-fixed rotation.
Throws
- If
dateis not a validDate. - If
dateis before 1972-01-01, or the model gives an angle that isn't finite.
Example
ts
import { PLANETS } from '@interstellar-tools/constants';
const mars = PLANETS.find((planet) => planet.id === 'mars')!;
const { pole, primeMeridian } = bodyOrientation(
mars.rotation!.iau!,
new Date('2026-06-20T23:58:50.816Z')
);
// pole { rightAscension: 317.6521, declination: 52.8700 }, primeMeridian 144.8722See
- bodyFixedFromInertialDcmIAU, for the matrix.
- subsolarPoint, for where the Sun is overhead.
- https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/pck00011.tpc NASA NAIF's
pck00011.tpc