Skip to content

Documentation / @interstellar-tools/equations / METERS_PER

Variable: METERS_PER ​

ts
const METERS_PER: Readonly<Record<DistanceUnitType, number>>;

Defined in: helpers/convert-distance-unit.ts:32

Meters-per-unit lookup for all canonical DistanceUnitType symbols.

  • Base: conversions are performed via meters.
  • Astronomical unit: au = 149 597 870 700 m, exact (from AU_METERS).
  • Light-year: c × Julian year (from METERS_PER_LY); kly/Mly/Gly are powers of 10 thereof.
  • Parsec: (648 000 / π) au (from METERS_PER_PC); kpc/Mpc/Gpc are powers of 10 thereof.
  • The table is frozen: it can be read, but not changed at runtime.

Example ​

ts
METERS_PER.km; // 1000
METERS_PER.au; // 149_597_870_700