Documentation / @interstellar-tools/equations / galactocentricToGalactic
Function: galactocentricToGalactic()
ts
function galactocentricToGalactic(
position: PositionInterface,
options?: GalactocentricToGalacticOptionsInterface
): GalacticDirectionAndDistanceInterface;Defined in: galactic/galactocentric-to-galactic.ts:90
The direction and distance from the Sun of a galactocentric position: the inverse of galactocentricPosition. It untilts the plane by
Notes
- Use the same
sunDistanceandsunHeightas the position was made with. - At the Sun itself, distance 0, the direction means nothing.
Parameters
| Parameter | Type | Description |
|---|---|---|
position | PositionInterface | A position in the 'galactocentric' frame. |
options? | GalactocentricToGalacticOptionsInterface | The unit of the distance, and the Sun's place, if not the defaults. |
Returns
GalacticDirectionAndDistanceInterface
The direction from the Sun, l from 0° up to 360°, and the distance.
Throws
If the position isn't in the 'galactocentric' frame, a coordinate isn't finite, or the Sun's height isn't less than its distance from the centre.
Example
ts
// The origin, the Milky Way's centre: R0 from the Sun, towards l = b = 0
const { direction, distance } = galactocentricToGalactic({
frame: 'galactocentric',
x: { value: 0, unit: 'pc' },
y: { value: 0, unit: 'pc' },
z: { value: 0, unit: 'pc' }
}); // direction { l: 0, b: 0 }, distance { value: 8275.9, unit: 'pc' }See
galactocentricPosition, its inverse.