defaultellipsoid.m 520 Bytes
Newer Older
Valentin Platzgummer's avatar
Valentin Platzgummer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
function ellipsoid = defaultellipsoid
%DEFAULTELLIPSOID  Return the WGS84 ellipsoid
%
%   ellipsoid = DEFAULTELLIPSOID
%
%   returns a vector of the equatorial radius and eccentricity for the
%   WGS84 ellipsoid.  use ecc2flat and flat2ecc to convert between
%   the eccentricity and the flattening.
%
%   See also ECC2FLAT, FLAT2ECC.

  persistent ell
  if isempty(ell)
    a = 6378137;
    f = 1/298.257223563;
    e = flat2ecc(f);
    ell = [a, e];
  end
  narginchk(0, 0)
  ellipsoid = ell;
end