Skip to content

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 T in Julian centuries and d in days from J2000.0 TDB, and θk=θ0,k+θ˙kT+θ¨kT2 the angle of each periodic term:

α0=α0+α˙T+∑kAksin⁡θkδ0=δ0+δ˙T+∑kAkcos⁡θkW=W0+W˙d+W¨d2+∑kAksin⁡θk

and the matrix is bodyFixedFromInertialDcmIAU of those angles, R3(W)R1(90°−δ0)R3(90°+α0).

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, W 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 10−12: 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 ​

ParameterTypeDescription
modelIauRotationModelInterfaceThe body's IAU rotation model, for example body.rotation.iau from a dataset.
dateDateThe moment, as a UTC Date, on or after 1972-01-01.

Returns ​

BodyOrientationInterface

The pole, the prime meridian's angle, and the ICRF → body-fixed rotation.

Throws ​

  • If date is not a valid Date.
  • If date is 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.8722

See ​