Documentation / @interstellar-tools/equations / galaxyDiskAxis
Function: galaxyDiskAxis()
ts
function galaxyDiskAxis(
direction: GalacticDirectionInterface,
disk: GalaxyDiskInterface,
options?: GalaxyDiskAxisOptionsInterface
): Vector3DTupleType;Defined in: galactic/galaxy-disk-axis.ts:82
The spin axis of a galaxy's disk, in the 'galactocentric' frame's axes: the unit vector its disk turns around, counter-clockwise seen from its tip. Draw the disk at right angles to it.
On the sky at the galaxy, with
Notes
- It needs the disk's
nearSide: without it, the disk could tilt either way. - Seen from the Sun, the disk turns counter-clockwise when
points towards us, as Andromeda's does.
Parameters
| Parameter | Type | Description |
|---|---|---|
direction | GalacticDirectionInterface | The galaxy's direction from the Sun, in galactic coordinates. |
disk | GalaxyDiskInterface | How its disk is turned on the sky. |
options? | GalaxyDiskAxisOptionsInterface | The Sun's place, for the frame's tilt, if not the default. |
Returns
The unit spin axis, in the 'galactocentric' frame's axes.
Throws
If the disk has no nearSide, the near side isn't 90° from positionAngle, an angle isn't finite, or the inclination is outside 0° to 90°.
Example
ts
import { GALAXIES } from '@interstellar-tools/constants';
const andromeda = GALAXIES.find((galaxy) => galaxy.id === 'andromeda')!;
const axis = galaxyDiskAxis(andromeda.direction!, andromeda.disk!);
// ≈ [-0.4186, -0.7544, -0.5057]