## Copyright (C) 2016
##
## This program is free software; you can redistribute it and/or modify it under
## the terms of the GNU General Public License as published by the Free Software
## Foundation; either version 3 of the License, or (at your option) any later
## version.
##
## This program is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
## details.
##
## You should have received a copy of the GNU General Public License along with
## this program; if not, see <http://www.gnu.org/licenses/>.

## -*- texinfo -*-
## @deftypefn  {Function File} {@var{ecc} =} flat2ecc (@var{flat}) 
## This will return the eccentricity given a flattening
## From https://en.wikipedia.org/wiki/Flattening
##
## e^2=2f-f^2
##
## where f is the flattening and e is the eccentricity
## earth_flattening=1/298.257=0.0033528
## and earth_eccentricity=.081819221456
##
## @example
## >>e=flat2ecc(0.0033528)
## e = 0.081819
## @end example
## @seealso{ecc2flat}
## @end deftypefn
function e = flat2ecc(f)
  e = sqrt(2 * f - f ^ 2);
  endfunction
