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:
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
for the geodesy functions with eccentricitySquaredOblateSpheroidin@interstellar-tools/equations, or as.
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));