Skip to content

Documentation / @interstellar-tools/constants / WGS84

Variable: WGS84 ​

ts
const WGS84: Readonly<
  EllipsoidInterface & {
    inverseFlattening: number;
  }
>;

Defined in: geodesy.ts:30

The WGS 84 reference ellipsoid: Earth's shape as GPS uses it.

Defined by its equatorial radius and flattening; the polar radius follows:

a=6378137 m,1f=298.257223563,b=a(1−f)≈6356752.314 m

Notes

  • The latitudes and heights of GPS receivers and most maps are on this ellipsoid.
  • The IAU's values for Earth (in PLANETS) agree to well under a metre, but come from a different fit; use WGS 84 for GPS coordinates.
  • Get e2 for the geodesy functions with eccentricitySquaredOblateSpheroid in @interstellar-tools/equations, or as f(2−f).

See ​

https://earth-info.nga.mil/index.php?dir=wgs84\&action=wgs84 NGA: World Geodetic System 1984

Example ​

ts
import { geodeticToBodyFixed } from '@interstellar-tools/equations';

const f = 1 / WGS84.inverseFlattening;
geodeticToBodyFixed(lat, lon, 0, WGS84.equatorialRadius.value, f * (2 - f));