Skip to content

Documentation / @interstellar-tools/equations / galacticToEquatorial

Function: galacticToEquatorial() ​

ts
function galacticToEquatorial(
  direction: GalacticDirectionInterface
): CelestialDirectionInterface;

Defined in: galactic/galactic-to-equatorial.ts:44

The right ascension and declination of a galactic direction: from galactic longitude l and latitude b to the ICRS (J2000), the inverse of equatorialToGalactic, with the transpose of the Hipparcos matrix AG.

Notes

  • At the celestial poles, the right ascension is 0.

Parameters ​

ParameterTypeDescription
directionGalacticDirectionInterfaceGalactic longitude l and latitude b, in degrees.

Returns ​

CelestialDirectionInterface

Right ascension, from 0° up to 360°, and declination, from −90° to 90°.

Throws ​

If an angle isn't finite, or b is outside −90° to 90°.

Example ​

ts
import type { DegreesType } from '@interstellar-tools/types';

// The galactic centre, l = b = 0
const centre = galacticToEquatorial({
  l: 0 as DegreesType,
  b: 0 as DegreesType
}); // { rightAscension: 266.4050, declination: -28.9362 }

See ​

equatorialToGalactic, its inverse.