: hgt = egm96geoid (lat, lon)
: hgt = egm96geoid (lat, lon, method)
: hgt = egm96geoid ()
: hgt = egm96geoid (samplefactor)

Return local height of EGM96 geoid relative to WGS84 geoid in meters.

The input values lat, lon are in (decimal) degrees. Scalar values as well as vectors/2D arrays are accepted are accepted, in the latter case the dimensions of lon and lat should match. They are wrapped in the latitude = [-90:90] and longitude [-180:180] intervals.

The optional third input method defines the interpolation method and can be one of the following: "nearest" (default), "linear", "pchip"/"cubic" (same ), or "spline". When "spline" is specified the latitude and longitude data should be either scalars or vectors of uniform spacing in ’meshgrid’ format and orientation.

Alternatively, egm96geoid can return the base grid or a sampled base grid. If called without input argument, the entire 721x1441 base grid is returned. If just one input argument is specified it must be a positive integer value which is then interpreted as a sampling factor: the grid is returned but sampled starting at (1,1) with values at (1:<samplefactor>:end). Positions (1, 1), (721, 1), (1441, 1) and (721, 721) of the base grid correspond to (Lon, Lat) = (0, 90), (180, 90), (360, 90) = (0, 90), and (180, -90), respectively.

hgt, the egm96geoid output value(s), are in meters relative to the WGS84 standard ellipsoid.

h = egm96geoid (-20.05, 59.81)
 ==>
 ans = 60.614

The geoid elevation data are based on interpolation using a 15’ x 15’ grid obtained from: https://www.usna.edu/Users/oceano/pguth/md_help/html/egm96.htm As a consequence the accuracy is highly dependent on the input latitude: near the equator, interpolation is based on a 27.76 x 27.76 km square grid, while near the poles the grid cells are effectively more needle-like triangles with a base of merely 121 m and a height of 27.76 km.

See also: interp2, referenceEllipsoid.

Package: mapping