# HG changeset patch
# User Philip Nienhuis <prnienhuis@users@sf.net>
# Date 1427488449 -3600
#      Fri Mar 27 21:34:09 2015 +0100
# Node ID b22805479ab0c0e6f37e8ed38e0e4c1bf551bace
# Parent  be0384fa400878986928b862de398fd2c7eed1ae
Adapt to Octave coding style

diff -r be0384fa4008 -r b22805479ab0 inst/Read Me
--- a/inst/Read Me	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/Read Me	Fri Mar 27 21:34:09 2015 +0100
@@ -1,33 +1,30 @@
-% Copyright (c) 2013, Sandeep V. Mahanthi
-% Copyright (c) 2013, Felipe G. Nievinski
-% Copyright (c) 2011, Felipe G. Nievinski
-%
-% All rights reserved.
-% 
-% Redistribution and use in source and binary forms, with or without
-% modification, are permitted provided that the following conditions are
-% met:
-% 
-%     * Redistributions of source code must retain the above copyright
-%       notice, this list of conditions and the following disclaimer.
-%     * Redistributions in binary form must reproduce the above copyright
-%       notice, this list of conditions and the following disclaimer in
-%       the documentation and/or other materials provided with the distribution
-% 
-% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-% POSSIBILITY OF SUCH DAMAGE.
+## Copyright (c) 2013, Sandeep V. Mahanthi
+## Copyright (c) 2011,2013 Felipe G. Nievinski
+##
+## All rights reserved.
+## 
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## 
+##     * Redistributions of source code must retain the above copyright
+##       notice, this list of conditions and the following disclaimer.
+##     * Redistributions in binary form must reproduce the above copyright
+##       notice, this list of conditions and the following disclaimer in
+##       the documentation and/or other materials provided with the distribution
+## 
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+## POSSIBILITY OF SUCH DAMAGE.
 
 There are certain changes by which these functions are different from their Matlab counterparts. 
 These functions accept a string for the Reference ellipsoid object. So, if your reference ellipsoid is
 wgs84, then you have to specify 'wgs84' as the input string. Alternatively, it also accepts structure as input. 
-
-
diff -r be0384fa4008 -r b22805479ab0 inst/aer2ecef.m
--- a/inst/aer2ecef.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/aer2ecef.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -16,21 +14,21 @@
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
+##
+## AER2ECEF converts Local spherical AER to geocentric ECEF
 
-function [x,y,z] = aer2ecef(az,elev,slantRange,lat0,lon0,h0,ell,angleut)
-%AER2ECEF converts Local spherical AER to geocentric ECEF
-%Checking if in Degrees or Radians
-  if (nargin<8)
-    angleut = 'degree';
-  endif
-  % Origin of the local system in geocentric coordinates.
-  [x0,y0,z0] = geodetic2ecef(lat0,lon0,h0,ell,angleut);
-  % Convert Local Spherical AER to ENU
-  [xEast, yNorth, zUp] = aer2enu(az, elev, slantRange,angleut);
-  % Rotating ENU to ECEF
-  [dx, dy, dz] = enu2ecefv(xEast, yNorth, zUp, lat0, lon0,angleut);
-  % Origin + offset from origin equals position in ECEF
-  x = x0+dx;
-  y = y0+dy;
-  z = z0+dz;
-endfunction
\ No newline at end of file
+function [x,y,z] = aer2ecef (az, elev, slantRange, lat0, lon0, h0, ell, ...
+                             angleut="degree")
+
+  ## Origin of the local system in geocentric coordinates.
+  [x0, y0, z0] = geodetic2ecef (lat0, lon0, h0, ell, angleut);
+  ## Convert Local Spherical AER to ENU
+  [xEast, yNorth, zUp] = aer2enu (az, elev, slantRange, angleut);
+  ## Rotating ENU to ECEF
+  [dx, dy, dz] = enu2ecefv (xEast, yNorth, zUp, lat0, lon0, angleut);
+  ## Origin + offset from origin equals position in ECEF
+  x = x0 + dx;
+  y = y0 + dy;
+  z = z0 + dz;
+
+endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/aer2enu.m
--- a/inst/aer2enu.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/aer2enu.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -15,17 +13,17 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-function [xEast,yNorth,zUp] = aer2enu(az,elev,slantRange,angleut)
-%AER2ENU
-%Checking if input is in degree or radian
-  if (nargin < 4 || strcmpi(angleut,'degree'))
-    angleut = 'degree';
-  endif
-  [sinfun,cosfun] = get_sinefun(angleut);
-%Calculation of AER2ENU
+## <http://www.gnu.org/licenses/>.
+##
+## AER2ENU
+
+function [xEast, yNorth, zUp] = aer2enu (az, elev, slantRange, angleut="degree")
+
+  [sinfun, cosfun] = get_sinefun (angleut);
+  ## Calculation of AER2ENU
   zUp = slantRange .* sinfun(elev);
   r   = slantRange .* cosfun(elev);
   xEast  = r .* sinfun(az);
-  yNorth = r .* cosfun(az);
+  yNorth = r .* cosfun(az);
+
 endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/aer2geodetic.m
--- a/inst/aer2geodetic.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/aer2geodetic.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -15,14 +13,16 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-function [lat1,lon1,h1] = aer2geodetic(az,elev,slantRange,lat0,lon0,h0,ell,angleut)
-  %AER2GEODETIC
-  %Convert AER2ECEF
-  if (nargin<8)
-    angleut = 'degree';
-  endif
-  [x,y,z] = aer2ecef(az,elev,slantRange,lat0,lon0,h0,ell,angleut);
-  %Convert ECEF2GEODETIC
-  [lat1,lon1,h1] = ecef2geodetic(x,y,z,ell,angleut);
-endfunction
\ No newline at end of file
+## <http://www.gnu.org/licenses/>.
+##
+## AER2GEODETIC 
+
+function [lat1, lon1, h1] = aer2geodetic (az, elev, slantRange, lat0, lon0, ...
+                            h0, ell, angleut)
+
+  ## Convert AER2ECEF
+  [x, y, z] = aer2ecef (az, elev, slantRange, lat0, lon0, h0, ell, angleut);
+  ## Convert ECEF2GEODETIC
+  [lat1, lon1, h1] = ecef2geodetic (x, y, z, ell, angleut);
+
+endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/aer2ned.m
--- a/inst/aer2ned.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/aer2ned.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -15,12 +13,14 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-function [xNorth,yEast,zDown] = aer2ned(az,elev,slantRange,angleut)
-%AER2NED Local spherical AER to Cartesian NED
-  if (nargin<4)
-    angleut = 'degree';
-  endif
-  [xNorth,yEast,zUp] = aer2enu(az,elev,slantRange,angleut);
-  zDown = -zUp;
-endfunction
\ No newline at end of file
+## <http://www.gnu.org/licenses/>.
+##
+## AER2NED Local spherical AER to Cartesian NED
+
+function [xNorth, yEast, zDown] = aer2ned (az, elev, slantRange, ...
+                                           angleut="degree")
+
+  [xNorth, yEast, zUp] = aer2enu (az, elev, slantRange, angleut);
+  zDown = -zUp;
+
+endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/compute_prime_vertical_radius.m
--- a/inst/compute_prime_vertical_radius.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/compute_prime_vertical_radius.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,31 +1,32 @@
-% Copyright (c) 2013, Sandeep V. Mahanthi
-% Copyright (c) 2013, Felipe G. Nievinski
-% Copyright (c) 2011, Felipe G. Nievinski
-%
-% All rights reserved.
-% 
-% Redistribution and use in source and binary forms, with or without
-% modification, are permitted provided that the following conditions are
-% met:
-% 
-%     * Redistributions of source code must retain the above copyright
-%       notice, this list of conditions and the following disclaimer.
-%     * Redistributions in binary form must reproduce the above copyright
-%       notice, this list of conditions and the following disclaimer in
-%       the documentation and/or other materials provided with the distribution
-% 
-% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-% POSSIBILITY OF SUCH DAMAGE.
+## Copyright (c) 2013, Sandeep V. Mahanthi
+## Copyright (c) 2011,2013 Felipe G. Nievinski
+##
+## All rights reserved.
+## 
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## 
+##     * Redistributions of source code must retain the above copyright
+##       notice, this list of conditions and the following disclaimer.
+##     * Redistributions in binary form must reproduce the above copyright
+##       notice, this list of conditions and the following disclaimer in
+##       the documentation and/or other materials provided with the distribution
+## 
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+## POSSIBILITY OF SUCH DAMAGE.
+
 function N = compute_prime_vertical_radius (lat, ell)
-    N = get_radius_normal (lat, ell);
-end
 
+  N = get_radius_normal (lat, ell);
+
+endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/ecef2aer.m
--- a/inst/ecef2aer.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/ecef2aer.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -15,11 +13,12 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-function [az,elev,slantRange] = ecef2aer(x, y, z, lat0, lon0, h0, ell, angleut)
-  if (nargin<8)
-    angleut = 'degree';
-  endif
-  [xEast, yNorth, zUp] = ecef2enu(x, y, z, lat0, lon0, h0, ell,angleut);
-  [az,elev,slantRange] = enu2aer(xEast, yNorth, zUp,angleut);
+## <http://www.gnu.org/licenses/>.
+
+function [az, elev, slantRange] = ecef2aer (x, y, z, lat0, lon0, h0, ell, ...
+                                            angleut="degree")
+
+  [xEast, yNorth, zUp] = ecef2enu (x, y, z, lat0, lon0, h0, ell, angleut);
+  [az,elev,slantRange] = enu2aer (xEast, yNorth, zUp, angleut);
+
 endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/ecef2enu.m
--- a/inst/ecef2enu.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/ecef2enu.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -15,11 +13,11 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-function [xEast,yNorth,zUp] = ecef2enu(x, y, z, lat0, lon0, h0, ell, angleut)
-  if (nargin<8)
-    angleut = 'degree';
-  endif
-  [x0,y0,z0] = geodetic2ecef(lat0, lon0, h0,ell, angleut);
-  [xEast, yNorth, zUp] = ecef2enuv(x - x0, y - y0, z - z0, lat0, lon0,angleut);
-endfunction
\ No newline at end of file
+## <http://www.gnu.org/licenses/>.
+
+function [xEast,yNorth,zUp] = ecef2enu (x, y, z, lat0, lon0, h0, ell, angleut="degree")
+
+  [x0, y0, z0] = geodetic2ecef (lat0, lon0, h0, ell, angleut);
+  [xEast, yNorth, zUp] = ecef2enuv (x - x0, y - y0, z - z0, lat0, lon0, angleut);
+
+endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/ecef2enuv.m
--- a/inst/ecef2enuv.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/ecef2enuv.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -15,14 +13,15 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-function [uEast, vNorth, wUp] = ecef2enuv(u, v, w, lat0, lon0, angleut)
-  if (nargin < 6 || strcmpi(angleut,'degree'))
-    angleut = 'degree';
-  endif
-  [sinfun,cosfun] = get_sinefun(angleut);
-  t     =  cosfun(lon0) .* u + sinfun(lon0) .* v;
-  uEast = -sinfun(lon0) .* u + cosfun(lon0) .* v;
+## <http://www.gnu.org/licenses/>.
+
+function [uEast, vNorth, wUp] = ecef2enuv (u, v, w, lat0, lon0, ...
+                                           angleut="degree")
+
+  [sinfun, cosfun] = get_sinefun (angleut);
+  t      =  cosfun(lon0) .* u + sinfun(lon0) .* v;
+  uEast  = -sinfun(lon0) .* u + cosfun(lon0) .* v;
   wUp    =  cosfun(lat0) .* t + sinfun(lat0) .* w;
-  vNorth = -sinfun(lat0) .* t + cosfun(lat0) .* w;
-endfunction
\ No newline at end of file
+  vNorth = -sinfun(lat0) .* t + cosfun(lat0) .* w;
+
+endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/ecef2geodetic.m
--- a/inst/ecef2geodetic.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/ecef2geodetic.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -17,55 +15,59 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-% The variables x,y,z are scalar geocentric coordinates. Their values can be 
-% scalar integers. ell is the ellipsoid refernce shape. The input is a string
-% which specifies the type of reference ellipsoid that is to be used. Ell can also be 
-% an structure with values specified at ell.a as semimajor axis, ell.b as semiminor axis
-% and ell.e as eccentricity. The output is in radians. 
+## The variables x,y,z are scalar geocentric coordinates. Their values can be 
+## scalar integers. ell is the ellipsoid refernce shape. The input is a string
+## which specifies the type of reference ellipsoid that is to be used. Ell can also be 
+## an structure with values specified at ell.a as semimajor axis, ell.b as semiminor axis
+## and ell.e as eccentricity. The output is in radians. 
 
-function [lat,lon,h] = ecef2geodetic(x,y,z,ell)
-  if(nargin<4)
+function [lat,lon,h] = ecef2geodetic (x, y, z, ell)
+
+  if (nargin < 4)
    ell = get_ellipsoid();
-  elseif (isstruct(ell)~= 1)
-   ell = get_ellipsoid(ell); 
+  elseif (! isstruct(ell))
+   ell = get_ellipsoid (ell); 
   endif
 
-  if (x==0 && y==0 && z==0)
+  if (x == 0 && y == 0 && z == 0)
     lat = 0;
     lon = 0;
     h = 0;
     return;
   endif
 
-% Algorithm is based on 
-% http://www.astro.uni.torun.pl/~kb/Papers/geod/Geod-BG.htm
-% This algorithm provides a converging solution to the latitude equation
-% in terms of the parametric or reduced latitude form (v)
-% This algorithm provides a uniform solution over all latitudes as it does not involve division by cos(phi) or sin(phi)
+  ## Algorithm is based on 
+  ## http://www.astro.uni.torun.pl/~kb/Papers/geod/Geod-BG.htm
+  ## This algorithm provides a converging solution to the latitude equation
+  ## in terms of the parametric or reduced latitude form (v)
+  ## This algorithm provides a uniform solution over all latitudes as it does
+  ## not involve division by cos(phi) or sin(phi)
   a = ell.a; 
   b = ell.b;
-  r = hypot(x,y);
-  % Constant required for Latitude equation
-  rho = atan2(b*z,a*r);  
-  % Constant required for latitude equation
-  c = (a^2 - b^2)./sqrt((a*r).^2 + (b*z).^2);  
+  r = hypot (x, y);
+  ## Constant required for Latitude equation
+  rho = atan2 (b * z, a * r);  
+  ## Constant required for latitude equation
+  c = (a^2 - b^2) ./ sqrt ((a * r).^2 + (b * z).^2);  
   count = 0;
-  % Starter for the Newtons Iteration Method
-  vnew = atan2(a*z,b*r);  
-  % Initializing the parametric latitude
+  ## Starter for the Newtons Iteration Method
+  vnew = atan2 (a * z, b * r);  
+  ## Initializing the parametric latitude
   v = 0;
-  while (v == vnew || count<5)
+  while (v == vnew || count < 5)
     v = vnew;
-    % Derivative of latitude equation
-    w = 2*(cos(v - rho) - c.*cos(2*v)); 
-    % Newtons Method for computing iterations  
-    vnew = v - ((2*sin(v-rho)-c.*sin(2*v))./w);  
-    count = count + 1;  
+    ## Derivative of latitude equation
+    w = 2 * (cos (v - rho) - c .* cos (2 * v)); 
+    ## Newtons Method for computing iterations  
+    vnew = v - ((2 * sin (v - rho) - c .* sin (2 * v)) ./ w);  
+    ++count;
   endwhile
-  % Computing latitude from the root of the latitude equation
-  lat = atan2((a*tan(vnew)),b); 
-  % Computing longitude
-  lon = atan2(y,x); 
-  % Computing h from latitude obtained 
-  h = ((r-(a*cos(vnew))).*cos(lat))+((z-(b*sin(vnew))).*sin(lat)); 
+  ## Computing latitude from the root of the latitude equation
+  lat = atan2 (( a * tan (vnew)), b); 
+  ## Computing longitude
+  lon = atan2 (y, x); 
+  ## Computing h from latitude obtained 
+  h = ((r - (a * cos (vnew))) .* cos (lat)) +  ...
+      ((z - (b * sin (vnew))) .* sin (lat));
+
 endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/ecef2ned.m
--- a/inst/ecef2ned.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/ecef2ned.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -15,11 +13,12 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-function [xNorth, yEast, zDown] = ecef2ned(x, y, z, lat0, lon0, h0, ell, angleut)
-  if (nargin<8)
-    angleut = 'degree';
-  endif
-  [yEast, xNorth, zUp] = ecef2enu(x, y, z, lat0, lon0, h0, ell, angleut);
-  zDown = -zUp;
-endfunction
\ No newline at end of file
+## <http://www.gnu.org/licenses/>.
+
+function [xNorth, yEast, zDown] = ecef2ned (x, y, z, lat0, lon0, h0, ell, ...
+                                            angleut="degree")
+
+  [yEast, xNorth, zUp] = ecef2enu (x, y, z, lat0, lon0, h0, ell, angleut);
+  zDown = -zUp;
+
+endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/ecef2nedv.m
--- a/inst/ecef2nedv.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/ecef2nedv.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -15,11 +13,12 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-function [xEast, yNorth, zDown] = ecef2nedv(x, y, z, lat0, lon0,angleut)
-  if (nargin<6)
-    angleut = 'degree';
-  endif
-  [xEast, yNorth, zUp] = ecef2enuv(x, y, z, lat0, lon0,angleut);
-  zDown = -zUp;
-endfunction
\ No newline at end of file
+## <http://www.gnu.org/licenses/>.
+
+function [xEast, yNorth, zDown] = ecef2nedv (x, y, z, lat0, lon0, ...
+                                             angleut="degree")
+
+  [xEast, yNorth, zUp] = ecef2enuv (x, y, z, lat0, lon0, angleut);
+  zDown = -zUp;
+  
+endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/enu2aer.m
--- a/inst/enu2aer.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/enu2aer.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -15,17 +13,20 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-function [az, elev, slantRange] = enu2aer(xEast, yNorth, zUp, angleut)
-  if (nargin < 4 || strcmpi(angleut,'degree'))
+## <http://www.gnu.org/licenses/>.
+
+function [az, elev, slantRange] = enu2aer (xEast, yNorth, zUp, angleut="degree")
+
+  if (nargin < 4 || strcmpi(angleut, "degree" ))
     atan2fun = @atan2d;
-  elseif (strcmpi(angleut,'radian'))
+  elseif (strcmpi (angleut, " radian" ))
     atan2fun = @atan2;
   else
-    error('Unknown: %s input argument for unit',angleut)
+    error('Unknown: %s input argument for unit', angleut)
   endif
-  r = sqrt(xEast.^2 + yNorth.^2);
-  slantRange = sqrt(r.^2 + zUp.^2);
-  elev = atan2fun(zUp,r);
-  az = mod(atan2fun(xEast,yNorth),2*atan2fun(0,-1));
-endfunction
\ No newline at end of file
+  r = sqrt (xEast.^2 + yNorth.^2);
+  slantRange = sqrt (r.^2 + zUp.^2);
+  elev = atan2fun (zUp,r);
+  az = mod (atan2fun (xEast, yNorth), 2 * atan2fun (0,-1));
+
+endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/enu2ecef.m
--- a/inst/enu2ecef.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/enu2ecef.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -15,14 +13,15 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-function [x, y, z] = enu2ecef(xEast, yNorth, zUp, lat0, lon0, h0, ell, angleut)
-  if (nargin<8)
-    angleut = 'degree';
-  endif
-  [x0, y0, z0] = geodetic2ecef(lat0, lon0, h0,ell, angleut);
-  [dx, dy, dz] = enu2ecefv(xEast, yNorth, zUp, lat0, lon0, angleut);
+## <http://www.gnu.org/licenses/>.
+
+function [x, y, z] = enu2ecef (xEast, yNorth, zUp, lat0, lon0, h0, ell, ...
+                               angleut)
+
+  [x0, y0, z0] = geodetic2ecef (lat0, lon0, h0,ell, angleut);
+  [dx, dy, dz] = enu2ecefv (xEast, yNorth, zUp, lat0, lon0, angleut);
   x = x0 + dx;
   y = y0 + dy;
-  z = z0 + dz;
-endfunction
\ No newline at end of file
+  z = z0 + dz;
+
+endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/enu2ecefv.m
--- a/inst/enu2ecefv.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/enu2ecefv.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -15,14 +13,15 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-function [u, v, w] = enu2ecefv(uEast, vNorth, wUp, lat0, lon0, angleut)
-  if (nargin < 6 || strcmpi(angleut,'degree'))
-    angleut = 'degree';
-  endif
-  [sinfun,cosfun] = get_sinefun(angleut);
+## <http://www.gnu.org/licenses/>.
+
+function [u, v, w] = enu2ecefv (uEast, vNorth, wUp, lat0, lon0, ...
+                                angleut="degree")
+
+  [sinfun, cosfun] = get_sinefun (angleut);
   t = cosfun(lat0) .* wUp - sinfun(lat0) .* vNorth;
   w = sinfun(lat0) .* wUp + cosfun(lat0) .* vNorth;
   u = cosfun(lon0) .* t - sinfun(lon0) .* uEast;
-  v = sinfun(lon0) .* t + cosfun(lon0) .* uEast;
-endfunction
\ No newline at end of file
+  v = sinfun(lon0) .* t + cosfun(lon0) .* uEast;
+
+endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/enu2geodetic.m
--- a/inst/enu2geodetic.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/enu2geodetic.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -15,11 +13,12 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-function [lat, lon, h] = enu2geodetic(xEast, yNorth, zUp, lat0, lon0, h0, ell, angleut)
-  if (nargin<8)
-    angleut = 'degree';
-  endif
-  [x, y, z] = enu2ecef(xEast, yNorth, zUp, lat0, lon0, h0, ell, angleut);
-  [lat, lon, h] = ecef2geodetic(x, y, z,spheroid,angleut);
-endfunction
\ No newline at end of file
+## <http://www.gnu.org/licenses/>.
+
+function [lat, lon, h] = enu2geodetic (xEast, yNorth, zUp, lat0, lon0, ...
+                                       h0, ell, angleut="degree")
+
+  [x, y, z] = enu2ecef (xEast, yNorth, zUp, lat0, lon0, h0, ell, angleut);
+  [lat, lon, h] = ecef2geodetic (x, y, z, spheroid, angleut);
+
+endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/geodetic2aer.m
--- a/inst/geodetic2aer.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/geodetic2aer.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -15,12 +13,13 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-function [az, elev, slantRange] = geodetic2aer(lat, lon, h, lat0, lon0, h0, ell, angleut)
-  if (nargin<8)
-    angleut = 'degree';
-  endif
-  [xEast, yNorth, zUp] = geodetic2enu(lat, lon, h, lat0, lon0, h0, ell,angleut );
-  [az, elev, slantRange] = enu2aer(xEast, yNorth, zUp,angleut);
+## <http://www.gnu.org/licenses/>.
+
+function [az, elev, slantRange] = geodetic2aer (lat, lon, h, lat0, lon0, ...
+                                                h0, ell, angleut="degree")
+
+  [xEast, yNorth, zUp] = geodetic2enu (lat, lon, h, lat0, lon0, h0, ell, ...
+                                       angleut);
+  [az, elev, slantRange] = enu2aer (xEast, yNorth, zUp, angleut);
+
 endfunction
-
diff -r be0384fa4008 -r b22805479ab0 inst/geodetic2ecef.m
--- a/inst/geodetic2ecef.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/geodetic2ecef.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -15,90 +13,92 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-function [x,y,z] = geodetic2ecef (phi,lambda,h, ellipsoid,angleut)
-%CONVERT_TO_CARTESIAN: Convert to global Cartesian coordinates (ECEF), given geodetic curvilinear coordinates.
- coord_geod = [phi,lambda,h];
- if ((nargin < 4) || isempty(ellipsoid))
-   ell = get_ellipsoid();  
- elseif (isstruct(ellipsoid)~= 1)
-   ell = get_ellipsoid(ellipsoid); 
- endif
+## <http://www.gnu.org/licenses/>.
 
- if (nargin < 5 || strcmpi(angleut,'degree'))
-   angleut = 'degree';
- endif
- [sinfun,cosfun] = get_sinefun(angleut);
-    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-    % Auxiliary quantities
+function [x,y,z] = geodetic2ecef (phi, lambda, h, ellipsoid, angleut="degree")
+
+  ## CONVERT_TO_CARTESIAN: Convert to global Cartesian coordinates (ECEF),
+  ## given geodetic curvilinear coordinates.
+  coord_geod = [phi,lambda, h];
+  if ((nargin < 4) || isempty (ellipsoid))
+    ell = get_ellipsoid();
+  elseif (! isstruct (ellipsoid))
+    ell = get_ellipsoid (ellipsoid);
+  endif
 
-    % radius of curvature of the prime vertical section
- N = compute_prime_vertical_radius (coord_geod(:, 1), ell);
+  [sinfun, cosfun] = get_sinefun (angleut);
+  ## FIXME ?
+  ## Auxiliary quantities
 
+  ## Radius of curvature of the prime vertical section
+  N = compute_prime_vertical_radius (coord_geod(:, 1), ell);
+
+  ## Some shortnames for variables used often.
+  a = ell.a;  
+  b = ell.b;
     
-    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-    % Some shortnames for variables used often.
- a = ell.a;  b = ell.b;
-    
- lat = coord_geod(:, 1);
- lon = coord_geod(:, 2);
- h   = coord_geod(:, 3);
+  lat = coord_geod(:, 1);
+  lon = coord_geod(:, 2);
+  h   = coord_geod(:, 3);
        
-    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-    % Compute cartesian (geocentric) coordinates given 
-    % (curvilinear) geodetic coordinates.
- x = (N + h) .* cosfun(lat) .* cosfun(lon);
- y = (N + h) .* cosfun(lat) .* sinfun(lon);
- z = (N .* (b/a)^2 + h) .* sinfun(lat);
+  ## Compute cartesian (geocentric) coordinates given 
+  ## (curvilinear) geodetic coordinates.
+  x = (N + h) .* cosfun(lat) .* cosfun(lon);
+  y = (N + h) .* cosfun(lat) .* sinfun(lon);
+  z = (N .* (b / a)^2 + h) .* sinfun(lat);
     
     
 endfunction
 
 %!shared
-%! n = 10;  % number of points in each test set
+%! n = 10;  ## number of points in each test set
 %! 
-%! % The error below was determied experimentally, running all 
-%! % tests below.
+%! ## The error below was determined experimentally, running all 
+%! ## tests below.
 %! error = 1e-8;
 %!
-%! a = 6378206.4;  b = 6356583.8;  e = sqrt ( (a^2 - b^2) / (a^2));
-%! ell.a = a;  ell.b = b;  ell.e = e;
+%! a = 6378206.4;  
+%! b = 6356583.8;
+%! e = sqrt ( (a^2 - b^2) / (a^2));
+%! ell.a = a;
+%! ell.b = b;  
+%! ell.e = e;
 
 %!test
-%! % Points at south pole, random heights, random longitudes.
-%! lat = -90*ones(n, 1);
-%! lon = rand(n, 1)*360 - 180;  % random longitudes between [-180, +180)
-%! h = rand(n, 1) * 200 - 100;  % random heights between [-100, +100)
+%! ## Points at south pole, random heights, random longitudes.
+%! lat = -90 * ones (n, 1);
+%! lon = rand (n, 1) * 360 - 180;  ## random longitudes between [-180, +180)
+%! h = rand (n, 1) * 200 - 100;    ## random heights between [-100, +100)
 %! coord_geod = [lat, lon, h];
 %! 
-%! x = zeros(n, 1);
-%! y = zeros(n, 1);
-%! z = -(ell.b+h);
+%! x = zeros (n, 1);
+%! y = zeros (n, 1);
+%! z = -(ell.b + h);
 %! correct_answer = [x y z];
 %! 
 %! coord_cart = convert_to_cartesian (coord_geod, ell);
-%! myassert ( all(abs(coord_cart - correct_answer) < error) );
+%! myassert ( all (abs (coord_cart - correct_answer) < error) );
 
 %!test
-%! % Points on equatorial plane, at Greenwich meridian, random heights.
-%! lat = 0*ones(n, 1);
-%! lon = 0*ones(n, 1);
-%! h = rand(n, 1) * 200 - 100;  % random heights between [-100, +100)
+%! ## Points on equatorial plane, at Greenwich meridian, random heights.
+%! lat = zeros (n, 1);
+%! lon = zeros (n, 1);
+%! h = rand (n, 1) * 200 - 100;  ## random heights between [-100, +100)
 %! coord_geod = [lat, lon, h];
 %! 
-%! x = (ell.a+h);
-%! y = zeros(n, 1);
-%! z = zeros(n, 1);
+%! x = (ell.a + h);
+%! y = zeros (n, 1);
+%! z = zeros (n, 1);
 %! correct_answer = [x y z];
 %! 
 %! coord_cart = convert_to_cartesian (coord_geod, ell);
-%! myassert ( all(abs(coord_cart - correct_answer) < error) );
+%! myassert ( all (abs (coord_cart - correct_answer) < error) );
 
 %!test
-%! % Points on equatorial plane, at +90 degrees meridian, random heights.
-%! lat = 0*ones(n, 1);
-%! lon = +90*ones(n, 1);
-%! h = rand(n, 1) * 200 - 100;  % random heights between [-100, +100)
+%! ## Points on equatorial plane, at +90 degrees meridian, random heights.
+%! lat = zeros (n, 1);
+%! lon = +90 * ones (n, 1);
+%! h = rand (n, 1) * 200 - 100;  ## random heights between [-100, +100)
 %! coord_geod = [lat, lon, h];
 %! 
 %! x = zeros(n, 1);
@@ -107,68 +107,72 @@
 %! correct_answer = [x y z];
 %! 
 %! coord_cart = convert_to_cartesian (coord_geod, ell);
-%! myassert ( all(abs(coord_cart - correct_answer) < error) );
+%! myassert ( all (abs (coord_cart - correct_answer) < error) );
 
 %!test
-%! % Points on equatorial plane, at -90 degrees meridian, random heights.
-%! lat = 0*ones(n, 1);
-%! lon = -90*ones(n, 1);
-%! h = rand(n, 1) * 200 - 100;  % random heights between [-100, +100)
+%! ## Points on equatorial plane, at -90 degrees meridian, random heights.
+%! lat = zeros (n, 1);
+%! lon = -90 * ones (n, 1);
+%! h = rand (n, 1) * 200 - 100;  ## random heights between [-100, +100)
 %! coord_geod = [lat, lon, h];
 %! 
-%! x = zeros(n, 1);
-%! y = -(ell.a+h);
-%! z = zeros(n, 1);
+%! x = zeros (n, 1);
+%! y = -(ell.a + h);
+%! z = zeros (n, 1);
 %! correct_answer = [x y z];
 %! 
 %! coord_cart = convert_to_cartesian (coord_geod, ell);
-%! myassert ( all(abs(coord_cart - correct_answer) < error) );
+%! myassert ( all (abs (coord_cart - correct_answer) < error) );
 
 %!test
-%! % Points on equatorial plane, at 180 degrees meridian, random heights.
-%! lat = 0*ones(n, 1);
-%! lon = 180*ones(n, 1);
-%! h = rand(n, 1) * 200 - 100;  % random heights between [-100, +100)
+%! ## Points on equatorial plane, at 180 degrees meridian, random heights.
+%! lat = zeros (n, 1);
+%! lon = 180 * ones (n, 1);
+%! h = rand (n, 1) * 200 - 100;    ## random heights between [-100, +100)
 %! coord_geod = [lat, lon, h];
 %! 
-%! x = -(ell.a+h);
-%! y = zeros(n, 1);
-%! z = zeros(n, 1);
+%! x = -(ell.a + h);
+%! y = zeros (n, 1);
+%! z = zeros (n, 1);
 %! correct_answer = [x y z];
 %! 
 %! coord_cart = convert_to_cartesian (coord_geod, ell);
-%! myassert ( all(abs(coord_cart - correct_answer) < error) );
+%! myassert ( all (abs (coord_cart - correct_answer) < error) );
 
 %!test
-%! % Points on equatorial plane, random longitudes, random heights.
-%! lat = 0*ones(n, 1);
-%! lon = rand(n, 1)*360 - 180;  % random longitudes between [-180, +180)
-%! h = rand(n, 1) * 200 - 100;  % random heights between [-100, +100)
+%! ## Points on equatorial plane, random longitudes, random heights.
+%! lat = zeros(n, 1);
+%! lon = rand (n, 1) * 360 - 180;  ## random longitudes between [-180, +180)
+%! h = rand (n, 1) * 200 - 100;    ## random heights between [-100, +100)
 %! coord_geod = [lat, lon, h];
 %! 
 %! coord_cart = convert_to_cartesian (coord_geod, ell);
 %! x = coord_cart(:, 1);
 %! y = coord_cart(:, 2);
 %! z = coord_cart(:, 3);
-%! equatorial_radius = sqrt(x.^2 + y.^2) - h;
+%! equatorial_radius = sqrt (x.^2 + y.^2) - h;
 %! 
-%! myassert ( all( abs( equatorial_radius - ell.a*ones(n, 1) ) < error) );
-%! myassert ( all( abs( z - 0 ) < error) );
+%! myassert ( all ( abs ( equatorial_radius - ell.a * ones (n, 1) ) < error) );
+%! myassert ( all ( abs ( z - 0 ) < error) );
 
 %!test
-%! % Points on a sphere, random latitudes, random longitudes, random heights.
-%! a = 6378206.4;  b = a;  e = sqrt ( (a^2 - b^2) / (a^2));
-%! ell.a = a;  ell.b = b;  ell.e = e;
+%! ## Points on a sphere, random latitudes, random longitudes, random heights.
+%! a = 6378206.4;
+%! b = a;
+%! e = sqrt ( (a^2 - b^2) / (a^2));
+%! ell.a = a;
+%! ell.b = b;
+%! ell.e = e;
 %!
-%! lat = rand(n, 1)*180 - 90;   % random latitudes between [-90, +90)
-%! lon = rand(n, 1)*360 - 180;  % random longitudes between [-180, +180)
-%! h = rand(n, 1) * 200 - 100;  % random heights between [-100, +100)
+%! lat = rand (n, 1) * 180 - 90;   ## random latitudes between [-90, +90)
+%! lon = rand (n, 1) * 360 - 180;  ## random longitudes between [-180, +180)
+%! h = rand (n, 1) * 200 - 100;    ## random heights between [-100, +100)
 %! coord_geod = [lat lon h];
 %!
-%! % sherical formulas:
-%! x = (h + ell.a) .* cos(lon * pi/180) .* cos(lat * pi/180);
-%! y = (h + ell.a) .* sin(lon * pi/180) .* cos(lat * pi/180);
-%! z = (h + ell.a)                      .* sin(lat * pi/180);
+%! ## sherical formulas:
+%! x = (h + ell.a) .* cos(lon * pi / 180) .* cos (lat * pi / 180);
+%! y = (h + ell.a) .* sin(lon * pi / 180) .* cos (lat * pi / 180);
+%! z = (h + ell.a)                        .* sin (lat * pi / 180);
 %! coord_cart = [x y z];
 %! 
 %! answer_coord_cart = convert_to_cartesian (coord_geod, ell);
@@ -177,11 +181,10 @@
 %! answer_z = coord_cart(:, 3);
 %! 
 %! %answer_coord_cart - coord_cart
-%! myassert ( all(abs(answer_x - x) <= error) );
-%! myassert ( all(abs(answer_y - y) <= error) );
-%! myassert ( all(abs(answer_z - z) <= error) );
+%! myassert ( all (abs (answer_x - x) <= error) );
+%! myassert ( all (abs (answer_y - y) <= error) );
+%! myassert ( all (abs (answer_z - z) <= error) );
 
 %!test
 %! % empty in, empty out.
-%! myassert(isempty(convert_to_cartesian([])));
-
+%! myassert (isempty (convert_to_cartesian ([])));
diff -r be0384fa4008 -r b22805479ab0 inst/geodetic2enu.m
--- a/inst/geodetic2enu.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/geodetic2enu.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -15,18 +13,16 @@
 ##
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
-## <http://www.gnu.org/licenses/>.
-function [xEast, yNorth, zUp] = geodetic2enu(lat, lon, h, lat0, lon0, h0, ellipsoid, angleut)
+## <http://www.gnu.org/licenses/>.
 
-  if (nargin<8)
-    angleut = 'degree';
-  endif
-  [x1,y1,z1] = geodetic2ecef(lat,lon,h,ellipsoid,angleut);
-  [x2,y2,z2] = geodetic2ecef(lat0,lon0,h0,ellipsoid,angleut);
-  dx = x1-x2;
-  dy = y1-y2;
-  dz = z1-z2;
-  [xEast, yNorth, zUp] = ecef2enuv(dx, dy, dz, lat0, lon0, angleut);
+function [xEast, yNorth, zUp] = geodetic2enu (lat, lon, h, lat0, lon0, h0, ...
+                                              ellipsoid, angleut="degree")
+
+  [x1, y1, z1] = geodetic2ecef (lat, lon, h, ellipsoid, angleut);
+  [x2, y2, z2] = geodetic2ecef (lat0, lon0, h0, ellipsoid, angleut);
+  dx = x1 - x2;
+  dy = y1 - y2;
+  dz = z1 - z2;
+  [xEast, yNorth, zUp] = ecef2enuv (dx, dy, dz, lat0, lon0, angleut);
 
 endfunction
-
diff -r be0384fa4008 -r b22805479ab0 inst/geodetic2ned.m
--- a/inst/geodetic2ned.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/geodetic2ned.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,37 +1,35 @@
-% Copyright (c) 2013, Sandeep V. Mahanthi
-% Copyright (c) 2013, Felipe G. Nievinski
-% Copyright (c) 2011, Felipe G. Nievinski
-%
-% All rights reserved.
-% 
-% Redistribution and use in source and binary forms, with or without
-% modification, are permitted provided that the following conditions are
-% met:
-% 
-%     * Redistributions of source code must retain the above copyright
-%       notice, this list of conditions and the following disclaimer.
-%     * Redistributions in binary form must reproduce the above copyright
-%       notice, this list of conditions and the following disclaimer in
-%       the documentation and/or other materials provided with the distribution
-% 
-% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-% POSSIBILITY OF SUCH DAMAGE.
-function [xNorth, yEast, zDown] = geodetic2ned(lat, lon, h, lat0, lon0, h0, ell, angleut)
+## Copyright (c) 2013 Sandeep V. Mahanthi
+## Copyright (c) 2011,2013 Felipe G. Nievinski
+##
+## All rights reserved.
+## 
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## 
+##     * Redistributions of source code must retain the above copyright
+##       notice, this list of conditions and the following disclaimer.
+##     * Redistributions in binary form must reproduce the above copyright
+##       notice, this list of conditions and the following disclaimer in
+##       the documentation and/or other materials provided with the distribution
+## 
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+## POSSIBILITY OF SUCH DAMAGE.
 
- if (nargin<8)
-   angleut = 'degree';
- endif
- [yEast, xNorth, zUp] = geodetic2enu(lat, lon, h, lat0, lon0, h0, ell, angleut);
+function [xNorth, yEast, zDown] = geodetic2ned (lat, lon, h, lat0, lon0, ...
+                                                h0, ell, angleut="degree")
+
+ [yEast, xNorth, zUp] = geodetic2enu (lat, lon, h, lat0, lon0, h0, ell, ...
+                                      angleut);
  zDown = -zUp;
 
 endfunction
-
diff -r be0384fa4008 -r b22805479ab0 inst/get_J2.m
--- a/inst/get_J2.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/get_J2.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,135 +1,148 @@
 function J2 = get_J2 (a, b, omega, GM, get_q0_b, zero_neg_J2)
-%GET_J2: Return the ellipsoid J2 constant (related to flattening), given other ellipsoid defining constants.
 
-    if (nargin < 5) || isempty(get_q0_b),  get_q0_b = false;  end
-    if (nargin < 6),  zero_neg_J2 = true;  end
+## GET_J2: Return the ellipsoid J2 constant (related to flattening), given other
+## ellipsoid defining constants.
+
+    if (nargin < 5) || isempty (get_q0_b)
+      get_q0_b = false;
+    endif
+    if (nargin < 6)
+      zero_neg_J2 = true;
+    endif
     
-    if (a==b),  J2 = 0;  return;  end
-    if (b==0)
-        % see test case get_J2(a, 0, omega, GM) below.
-        f = @(delta) get_J2(a, a+delta, omega, GM, [], true);
-        [delta0, fval] = fzero(f, -2e4, -1e4);
-        myassert(fval, 0, sqrt(eps))
+    if (a == b)
+      J2 = 0;
+      return;
+    end
+    if (b == 0)
+        ## see test case get_J2(a, 0, omega, GM) below.
+        f = @(delta) get_J2(a, a + delta, omega, GM, [], true);
+        [delta0, fval] = fzero (f, -2e4, -1e4);
+        myassert (fval, 0, sqrt (eps))
         J2 = delta0;
         return;
     end
 
-    e       = sqrt( (a.^2 - b.^2) ./ a.^2 );
-    e_prime = sqrt( (a.^2 - b.^2) ./ b.^2 );
+    e       = sqrt ( (a.^2 - b.^2) ./ a.^2 );
+    e_prime = sqrt ( (a.^2 - b.^2) ./ b.^2 );
     m = omega.^2 .* a.^2 .* b ./ GM;
-    %m = (omega*(omega*b)) * (a*(a/GM));
+    ## m = (omega*(omega*b)) * (a*(a/GM));
 
     n = 1;
     sum = 0;
     term = eps + eps;
-    while any(abs(term) > eps(sum))
-        term = 4 * (-1)^(n+1) * n / ((2*n+1)*(2*n+3)) * e_prime.^(2*n+1);
-        sum = sum + term;
+    while (any (abs (term) > eps (sum))
+        term = 4 * (-1)^(n+1) * n / ((2*n + 1) * (2*n + 3)) * e_prime.^(2*n + 1);
+        sum += term;
         n = n + 1;
-    end
-    q0 = (1/2) * sum;
-    if get_q0_b
-        q0 = (1/2) * ( (1+3./e_prime.^2).*atan(e_prime) - 3./e_prime );
-    end
+    endwhile
+    q0 = sum + 0.5;
+    if (get_q0_b)
+        q0 = 0.5 * ( (1 + 3./e_prime.^2) .* atan (e_prime) - 3 ./ e_prime );
+    endif
     
-    J2  = e.^2/3.*(1 - (2/15).*m.*(e_prime./q0));
+    J2  = e.^2 / 3 .* (1 - (2 / 15) .* m .* (e_prime ./ q0));
 
-    % GRS80, by H. Moritz
+    ## GRS80, by H. Moritz
 
-    if zero_neg_J2
-        J2(J2<0) = 0;
-    end
-end
+    if (zero_neg_J2)
+        J2(J2 < 0) = 0;
+    endif
+
+endfunction
 
 %!test
-%! % multiple points
-%! n = 1 + ceil(10*rand);
-%! J2 = get_J2 (1, repmat(0.5, n, 1), 0, 1);
-%! myassert(size(J2), [n, 1])
+%! ## multiple points
+%! n = 1 + ceil (10 * rand);
+%! J2 = get_J2 (1, repmat (0.5, n, 1), 0, 1);
+%! myassert(size (J2), [n, 1])
 
 %!test
-%! % J2 = 0 for a = b, by definition.
-%! % (formulas above break down for a = b).
-%! myassert(get_J2(1, 1, [], []), 0)
+%! ## J2 = 0 for a = b, by definition.
+%! ## (formulas above break down for a = b).
+%! myassert (get_J2 (1, 1, [], []), 0)
 
 %!shared
-%! % GRS80 defining and derived constants:
+%! ## GRS80 defining and derived constants:
 %! a = 6378137;
 %! f = 1/298.257222101;
-%! b = a*(1-f);
-%! % get b from f and a:
-%! %b - 6356752.6141  % DEBUG
+%! b = a * (1 - f);
+%! ## get b from f and a:
+%! ## b - 6356752.6141  % DEBUG
 %! omega = 7292115e-11;
 %! GM = 3986005e8;
 %! J2 = 108263e-8;
-%! tol = 1e-8 / 2;  % half least significant digit in J2.
+%! tol = 1e-8 / 2;  ## half least significant digit in J2.
 
 %!test
-%! % check against reported values:
-%! J2b = get_J2(a, b, omega, GM);
+%! ## check against reported values:
+%! J2b = get_J2 (a, b, omega, GM);
 %! 
-%! %[J2, J2b, J2b-J2]
-%! myassert(J2b, J2, -tol)
+%! ##[J2, J2b, J2b - J2]
+%! myassert (J2b, J2, -tol)
 
 %!test
-%! % compare different implementations for q0:
-%! % (J2 should vary smoothly as b->a).
-%! delta = [-10:+1:-2, -1:+0.1:-0.1]';
+%! ## compare different implementations for q0:
+%! ## (J2 should vary smoothly as b->a).
+%! delta = [ -10 : +1 : -2, -1 : +0.1 : -0.1 ]';
 %! b = a + delta;
-%! myassert (all(a > b));
+%! myassert (all (a > b));
 %! 
 %! J2  = get_J2 (a, b, omega, GM, [], false);
 %! J2b = get_J2 (a, b, omega, GM, true, false);
 %! 
-%! %figure
-%! %subplot(1,2,1), plot(delta, J2,  '.-')
-%! %subplot(1,2,2), plot(delta, J2b, '.-')
-%! temp = corrcoef(delta, J2);   c  = temp(2,1);
-%! temp = corrcoef(delta, J2b);  cb = temp(2,1);
+%! ## figure
+%! ## subplot(1,2,1), plot(delta, J2,  '.-')
+%! ## subplot(1,2,2), plot(delta, J2b, '.-')
+%! temp = corrcoef (delta, J2);
+%! c  = temp(2, 1);
+%! temp = corrcoef (delta, J2b);
+%! cb = temp(2, 1);
 %! 
 %! %[J2, J2b, J2b-J2]
 %! %[c, cb], [c, cb] - (-1)  % DEBUG
-%! myassert(c, -1, -sqrt(eps));
+%! myassert (c, -1, -sqrt(eps));
 
 %!test
-%! % Interesting, J2(b==a)<>0, J2(a<>b)==0.
-%! % I.e., for a sphere (b==a), J2 is different than zero.
-%! % I think this behavior is NOT physical, just a 
-%! % numerical artifact that should be suppressed.
+%! ## Interesting, J2(b==a)<>0, J2(a<>b)==0.
+%! ## I.e., for a sphere (b==a), J2 is different than zero.
+%! ## I think this behavior is NOT physical, just a 
+%! ## numerical artifact that should be suppressed.
 %! 
-%! delta = linspace(b-a, 0, 10)';  delta(end) = [];
+%! delta = linspace (b - a, 0, 10)';
+%! delta(end) = [];
 %! b = a + delta;
-%! myassert (all(a > b));
+%! myassert (all (a > b));
 %! 
 %! J2  = get_J2 (a, b, omega, GM, [], false);
 %! J2b = get_J2 (a, b, omega, GM);
 %! 
-%! %[delta, J2, J2-J2(1)]
-%! %figure
-%! %plot(delta, J2,  '.-')
-%! %[J2, J2b]
-%! myassert(~any(J2b < 0))
+%! ## [delta, J2, J2-J2(1)]
+%! ## figure
+%! ## plot(delta, J2,  '.-')
+%! ## [J2, J2b]
+%! myassert (! any (J2b < 0))
 %! 
-%! delta0 = get_J2(a, 0, omega, GM);
-%! J20 = get_J2(a, a+delta0, omega, GM);
-%! myassert(J20, 0, -sqrt(eps));
-%! % is it affected by the lack of precision? NO!
-%! J20 = get_J2(a, a+single(delta0), omega, GM);
-%! myassert(isa(J20, 'single'));
-%! myassert(J20, 0, -sqrt(eps(single(1))));
-%! % b=a+delta0 yields J2=0.
+%! delta0 = get_J2 (a, 0, omega, GM);
+%! J20 = get_J2 (a, a + delta0, omega, GM);
+%! myassert (J20, 0, -sqrt (eps));
+%! ## is it affected by the lack of precision? NO!
+%! J20 = get_J2 (a, a + single (delta0), omega, GM);
+%! myassert (isa (J20, 'single'));
+%! myassert (J20, 0, -sqrt (eps (single (1))));
+%! ## b=a+delta0 yields J2=0.
 
 %!test
-%! % Trying to analyze J2 at the limit b->a.
-%! delta = [-10:+1:-2, -1:+0.1:-0.2, -0.1:+0.01:-0.02]';
+%! ## Trying to analyze J2 at the limit b->a.
+%! delta = [ -10 : +1 : -2, -1 : +0.1 : -0.2, -0.1 : +0.01 : -0.02]';
 %! b = a + delta;
 %! 
 %! J2 = get_J2 (a, b, omega, GM, [], false);
-%! J20 = interp1(delta, J2, 0, 'linear', 'extrap');
-%! % J20 = J2(a==b).
-%! temp = corrcoef(delta, J2);   c = temp(2,1);
+%! J20 = interp1 (delta, J2, 0, 'linear', 'extrap');
+%! ## J20 = J2(a == b).
+%! temp = corrcoef (delta, J2);
+%! c = temp(2, 1);
 %! 
-%! %figure, plot(delta, J2, '.-k');
-%! %J20, c
-%! myassert(c, -1, -sqrt(eps))
-
+%! ## figure, plot(delta, J2, '.-k');
+%! ## J20, c
+%! myassert (c, -1, -sqrt (eps));
diff -r be0384fa4008 -r b22805479ab0 inst/get_ellipsoid.m
--- a/inst/get_ellipsoid.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/get_ellipsoid.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,160 +1,170 @@
-% Copyright (c) 2013, Sandeep V. Mahanthi
-% Copyright (c) 2013, Felipe G. Nievinski
-% Copyright (c) 2011, Felipe G. Nievinski
-%
-% All rights reserved.
-% 
-% Redistribution and use in source and binary forms, with or without
-% modification, are permitted provided that the following conditions are
-% met:
-% 
-%     * Redistributions of source code must retain the above copyright
-%       notice, this list of conditions and the following disclaimer.
-%     * Redistributions in binary form must reproduce the above copyright
-%       notice, this list of conditions and the following disclaimer in
-%       the documentation and/or other materials provided with the distribution
-% 
-% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-% POSSIBILITY OF SUCH DAMAGE.
-function ell = get_ellipsoid (name)
-%GET_ELLIPSOID: Return geodetic ellipsoid information.
+## Copyright (c) 2013 Sandeep V. Mahanthi
+## Copyright (c) 2011,2013 Felipe G. Nievinski
+##
+## All rights reserved.
+## 
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## 
+##     * Redistributions of source code must retain the above copyright
+##       notice, this list of conditions and the following disclaimer.
+##     * Redistributions in binary form must reproduce the above copyright
+##       notice, this list of conditions and the following disclaimer in
+##       the documentation and/or other materials provided with the distribution
+## 
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+## POSSIBILITY OF SUCH DAMAGE.
 
-    if (nargin < 1) || isempty(name),  name = 'grs80';  end
-    switch lower(name)
-    case 'clk1866'
-        ell.a = 6378206.40;
-        ell.b = 6356583.80;
-        ell.f = (ell.a - ell.b) / ell.a;
-        ell.e = sqrt( (ell.a^2 - ell.b^2) / ell.a^2 );
-    case 'iau_earth'
-        ell.a = 6378.14e3;
-        ell.b = 6356.75e3;
-        ell.f = (ell.a - ell.b) / ell.a;
-        ell.e = sqrt( (ell.a^2 - ell.b^2) / ell.a^2 );
-    case 'grs80'
-        ell.a = 6378137;
-        ell.e_sq = 0.00669438002290;
-        ell.e = sqrt(ell.e_sq);
-        ell.b = ell.a * sqrt(1 - ell.e_sq);
-        ell.f = (ell.a - ell.b) / ell.a;
-    case 'int24'
-        % RESOLU��O IBGE 1/2005.
-        ell.a = 6378388;
-        ell.f = 1/297;
-        ell.b = ell.a * (1 - ell.f);
-        ell.e = sqrt( (ell.a^2 - ell.b^2) / ell.a^2 );
-    case 'int67'
-        % RESOLU��O IBGE No 23, DE 21 DE FEVEREIRO DE 1989
-        ell.a = 6378160;
-        ell.b = 6356774.719;
-        ell.f = (ell.a - ell.b) / ell.a;
-        ell.e = sqrt( (ell.a^2 - ell.b^2) / ell.a^2 );
-    case 'fake'
-        % I've made this ellipsoid really different from 
-        % Earth's shape, so as to have large discrepancies
-        % in gedetic coordinates expressed in this ellipsoid,
-        % compared to, say, GRS80 or WGS84.
-        ell.a = 6378000;
-        ell.b = 6300000;
-        ell.f = (ell.a - ell.b) / ell.a;
-        ell.e = sqrt( (ell.a^2 - ell.b^2) / ell.a^2 );
-    case 'wgs84'
-        %-% WGS-84 ellipsoid parameters.
-        
-        %   <http://earth-info.nga.mil/GandG/tr8350_2.html>
-        %   <ftp://164.214.2.65/pub/gig/tr8350.2/wgs84fin.pdf>
+function ell = get_ellipsoid (name="grs80")
 
-        ell.a = 6378137.0;  % semi-major axis
-        ell.f = 1.0 / 298.2572235630;  % flattening
-        ell.b = ell.a * (1 - ell.f);  % semi-minor axis
-        ell.e = sqrt ( (ell.a^2 - ell.b^2) / (ell.a^2));  % first eccentricity
+ ## GET_ELLIPSOID: Return geodetic ellipsoid information.
 
-        %-%
-        % Paremeters needed to evaluate the geopotential.
-        % I got them from the US National Geospatial-Inteligence Agency's
-        % website, "NGA/NASA EGM96, N=M=360 Earth Gravity Model" 
-        % (NGA > Products and Services >Geospatial Sciences Division 
-        % > Physical Geodesy Home)
-        % <http://earth-info.nga.mil/GandG/wgsegm/egm96.html>
-            
-        % Earth's Gravitational Constant w/ atmosphere:
-        ell.GM = 0.3986004418e15;  % m^3/s^2
-        
-        % Earth's angular speed:
-        ell.omega = 7292115.0e-11;   % rad/s
-        
-        % Dynamical form factor of the Earth:
-        % The four defining paramenters of WGS-84 are
-        % GM, omega, a, and 1/f. We need J2 instead of f:
-        ell.J2 = get_J2 (ell.a, ell.b, ell.omega, ell.GM);
+  switch lower (name)
+    case " clk1866" 
+      ell.a = 6378206.40;
+      ell.b = 6356583.80;
+      ell.f = (ell.a - ell.b) / ell.a;
+      ell.e = sqrt ( (ell.a^2 - ell.b^2) / ell.a^2 );
 
-        % value used to compute N from the EGM96 harmonic coefficients:
-        % (even though W_0 is not strictly related to the ellipsoid,
-        %  I thought that's the best place to keep it)
-        ell.W0 = 62636856.88;  % m^2 s^2
-        % Accordingly to eq. (11.2-3) in Chapter 11, "The EGM96 Geoid 
-        % Undulation With Respect to the WGS84 Ellipsoid", of the following 
-        % publication: The Development of the Joint NASA GSFC and NIMA 
-        % Geopotential Model EGM96, F. G. Lemoine, S. C. Kenyon, J. K. Factor, 
-        % R.G. Trimmer, N. K. Pavlis, D. S. Chinn, C. M. Cox, S. M. Klosko, 
-        % S. B. Luthcke, M. H. Torrence, Y. M. Wang, R. G. Williamson, 
-        % E. C. Pavlis, R. H. Rapp and T. R. Olson, NASA Goddard Space Flight 
-        % Center, Greenbelt, Maryland, 20771 USA, July 1998. Available at:
-        % <http://cddis.gsfc.nasa.gov/926/egm96/doc/S11.HTML>
-       
-        %-%
-        % Value taken from NIMA Technical Report TR8350.2, 
-        % "Department of Defense World Geodetic System 1984, Its Definition 
-        % and Relationships With Local Geodetic Systems", Third Edition, 
-        % 4 July 1997, available at
-        % <ftp://164.214.2.65/pub/gig/tr8350.2/wgs84fin.pdf>
-        % Table 3.4 (Derived physical constants), printed page 3-7, PDF page 40.
-        ell.U0 = 62636851.7146;  %  m^2/s^2
-        ell.U0_tol =    0.00005;  % half the least significant digit in U0
-    case {'wgs84_sph', 'sph', 'sphere'}
-        ell = get_ellipsoid('wgs84');
-        R = (ell.a + ell.b) / 2;
-        ell.a = R;
-        ell.b = R;
-        ell.f = 0;
-        ell.e = 0;
-        ell.J2 = 0;
-    case 'mean sphere'
-        R = 6371e3;
-        ell.a = R;
-        ell.b = R;
-        ell.f = 0;
-        ell.e = 0;
+    case "iau_earth"
+      ell.a = 6378.14e3;
+      ell.b = 6356.75e3;
+      ell.f = (ell.a - ell.b) / ell.a;
+      ell.e = sqrt ( (ell.a^2 - ell.b^2) / ell.a^2 );
+
+    case "grs80"
+      ell.a = 6378137;
+      ell.e_sq = 0.00669438002290;
+      ell.e = sqrt (ell.e_sq);
+      ell.b = ell.a * sqrt (1 - ell.e_sq);
+      ell.f = (ell.a - ell.b) / ell.a;
+
+    case "int24"
+      ## RESOLU��O IBGE 1/2005.
+      ell.a = 6378388;
+      ell.f = 1/297;
+      ell.b = ell.a * (1 - ell.f);
+      ell.e = sqrt ( (ell.a^2 - ell.b^2) / ell.a^2 );
+
+    case "int67"
+      ## RESOLU��O IBGE No 23, DE 21 DE FEVEREIRO DE 1989
+      ell.a = 6378160;
+      ell.b = 6356774.719;
+      ell.f = (ell.a - ell.b) / ell.a;
+      ell.e = sqrt ( (ell.a^2 - ell.b^2) / ell.a^2 );
+
+    case "fake"
+      ## I've made this ellipsoid really different from 
+      ## Earth's shape, so as to have large discrepancies
+      ## in gedetic coordinates expressed in this ellipsoid,
+      ## compared to, say, GRS80 or WGS84.
+      ell.a = 6378000;
+      ell.b = 6300000;
+      ell.f = (ell.a - ell.b) / ell.a;
+      ell.e = sqrt ( (ell.a^2 - ell.b^2) / ell.a^2 );
+
+    case "wgs84"
+      ##-## WGS-84 ellipsoid parameters.
+      
+      ##   <http://earth-info.nga.mil/GandG/tr8350_2.html>
+      ##   <ftp://164.214.2.65/pub/gig/tr8350.2/wgs84fin.pdf>
+
+      ell.a = 6378137.0;                                ## semi-major axis
+      ell.f = 1.0 / 298.2572235630;                     ## flattening
+      ell.b = ell.a * (1 - ell.f);                      ## semi-minor axis
+      ell.e = sqrt ( (ell.a^2 - ell.b^2) / (ell.a^2));  ## first eccentricity
+
+      ## Parameters needed to evaluate the geopotential.
+      ## I got them from the US National Geospatial-Inteligence Agency's
+      ## website, "NGA/NASA EGM96, N=M=360 Earth Gravity Model" 
+      ## (NGA > Products and Services >Geospatial Sciences Division 
+      ## > Physical Geodesy Home)
+      ## <http://earth-info.nga.mil/GandG/wgsegm/egm96.html>
+          
+      ## Earth's Gravitational Constant w/ atmosphere:
+      ell.GM = 0.3986004418e15;                         ## m^3/s^2
+      
+      ## Earth's angular speed:
+      ell.omega = 7292115.0e-11;                        ## rad/s
+      
+      ## Dynamical form factor of the Earth:
+      ## The four defining paramenters of WGS-84 are
+      ## GM, omega, a, and 1/f. We need J2 instead of f:
+      ell.J2 = get_J2 (ell.a, ell.b, ell.omega, ell.GM);
+
+      ## value used to compute N from the EGM96 harmonic coefficients:
+      ## (even though W_0 is not strictly related to the ellipsoid,
+      ##  I thought that's the best place to keep it)
+      ell.W0 = 62636856.88;                             ## m^2 s^2
+      ## Accordingly to eq. (11.2-3) in Chapter 11, "The EGM96 Geoid 
+      ## Undulation With Respect to the WGS84 Ellipsoid", of the following 
+      ## publication: The Development of the Joint NASA GSFC and NIMA 
+      ## Geopotential Model EGM96, F. G. Lemoine, S. C. Kenyon, J. K. Factor, 
+      ## R.G. Trimmer, N. K. Pavlis, D. S. Chinn, C. M. Cox, S. M. Klosko, 
+      ## S. B. Luthcke, M. H. Torrence, Y. M. Wang, R. G. Williamson, 
+      ## E. C. Pavlis, R. H. Rapp and T. R. Olson, NASA Goddard Space Flight 
+      ## Center, Greenbelt, Maryland, 20771 USA, July 1998. Available at:
+      ## <http://cddis.gsfc.nasa.gov/926/egm96/doc/S11.HTML>
+     
+      ##-##
+      ## Value taken from NIMA Technical Report TR8350.2, 
+      ## "Department of Defense World Geodetic System 1984, Its Definition 
+      ## and Relationships With Local Geodetic Systems", Third Edition, 
+      ## 4 July 1997, available at
+      ## <ftp://164.214.2.65/pub/gig/tr8350.2/wgs84fin.pdf>
+      ## Table 3.4 (Derived physical constants), printed page 3-7, PDF page 40.
+      ell.U0 = 62636851.7146;                           ##  m^2/s^2
+      ell.U0_tol =    0.00005;                          ## half the least sign-
+                                                        ## ificant digit in U0
+
+    case {"wgs84_sph", "sph", "sphere"}
+      ell = get_ellipsoid ("wgs84");
+      R = (ell.a + ell.b) / 2;
+      ell.a = R;
+      ell.b = R;
+      ell.f = 0;
+      ell.e = 0;
+      ell.J2 = 0;
+
+    case "mean sphere"
+      R = 6371e3;
+      ell.a = R;
+      ell.b = R;
+      ell.f = 0;
+      ell.e = 0;
+
     otherwise
-        error('MATLAB:get_ellipsoid:unkEll', 'Unknown ellipsoid name "%s".', name);
+      error ("get_ellipsoid: Unknown ellipsoid name '%s'.", name);
+
     end
 end
 
 %!test
-%! names = {'grs80', 'int24', 'int67', 'fake', 'wgs84', 'wgs84_sph', 'sph'};
-%! for i=1:length(names)
+%! names = {"grs80", "int24", "int67", "fake", "wgs84", "wgs84_sph", "sph"};
+%! for i=1:length (names)
 %!     get_ellipsoid (names{i});
 %! end
 
 %!test
 %! % get_ellipsoid ()
-%! lasterror('reset')
+%! lasterror (" reset" )
 
 %!error
-%! get_ellipsoid('WRONG');
+%! get_ellipsoid (" WRONG" );
 
 %!test
-%! % get_ellipsoid ()
+%! ## get_ellipsoid ()
 %! s = lasterror;
-%! %s
-%! myassert(strcmp(s.identifier, 'MATLAB:get_ellipsoid:unkEll'));
-
+%! ##s
+## FIXME    this error stmt doesn' t work in Octave
+%! myassert (strcmp (s.identifier, 'MATLAB:get_ellipsoid:unkEll'));
diff -r be0384fa4008 -r b22805479ab0 inst/get_radius_normal.m
--- a/inst/get_radius_normal.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/get_radius_normal.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,74 +1,77 @@
-% Copyright (c) 2013, Sandeep V. Mahanthi
-% Copyright (c) 2013, Felipe G. Nievinski
-% Copyright (c) 2011, Felipe G. Nievinski
-%
-% All rights reserved.
-% 
-% Redistribution and use in source and binary forms, with or without
-% modification, are permitted provided that the following conditions are
-% met:
-% 
-%     * Redistributions of source code must retain the above copyright
-%       notice, this list of conditions and the following disclaimer.
-%     * Redistributions in binary form must reproduce the above copyright
-%       notice, this list of conditions and the following disclaimer in
-%       the documentation and/or other materials provided with the distribution
-% 
-% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-% POSSIBILITY OF SUCH DAMAGE.
+## Copyright (c) 2013 Sandeep V. Mahanthi
+## Copyright (c) 2011,2013 Felipe G. Nievinski
+##
+## All rights reserved.
+## 
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## 
+##     * Redistributions of source code must retain the above copyright
+##       notice, this list of conditions and the following disclaimer.
+##     * Redistributions in binary form must reproduce the above copyright
+##       notice, this list of conditions and the following disclaimer in
+##       the documentation and/or other materials provided with the distribution
+## 
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+## POSSIBILITY OF SUCH DAMAGE.
+##
+## GET_RADIUS_NORMAL: Return the normal (i.e., along the prime vertical section)
+## ellipsoidal radius of curvature, at a given geodetic latitude.
+
 function N = get_radius_normal (lat, ell)
-%GET_RADIUS_NORMAL: Return the normal (i.e., along the prime vertical section) ellipsoidal radius of curvature, at a given geodetic latitude.
 
-    a = ell.a;  b = ell.b;
-    lat2 = lat .* (pi/180);
-    N = a^2 ./ sqrt( a^2 .* (cos(lat2)).^2 + b^2 .* (sin(lat2)).^2 );
+    a = ell.a;
+    b = ell.b;
+    lat2 = lat .* (pi / 180);
+    N = a^2 ./ sqrt ( a^2 .* (cos (lat2)).^2 + b^2 .* (sin (lat2)).^2 );
+
 end
 
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Test block (see help test on GNU Octave).
+## Test block (see help test on GNU Octave).
 
 %!shared
-%! ell = get_ellipsoid('grs80');
-%! n = ceil(10*rand);
-%! lat = rand(n, 1);
+%! ell = get_ellipsoid (" grs80" );
+%! n = ceil (10 * rand);
+%! lat = rand (n, 1);
 
 %!test
-%! % When a = b (i.e., the the ellipsoid degenerates into a sphere),
-%! % N = a everywhere.
-%! ell.a = 1;  ell.b = ell.a;  ell.e = 0;
+%! ## When a = b (i.e., the the ellipsoid degenerates into a sphere),
+%! ## N = a everywhere.
+%! ell.a = 1;
+%! ell.b = ell.a;
+%1 ell.e = 0;
 %! lat = 0:90:360;
 %! N = get_radius_normal (lat, ell);
-%! correct_answer = ell.a * ones(size(lat));
-%! myassert (N, correct_answer, -sqrt(eps));
+%! correct_answer = ell.a * ones (size (lat));
+%! myassert (N, correct_answer, -sqrt (eps));
 
 %!test
-%! % At the equator:
+%! ## At the equator:
 %! lat = 0;
-%! N = get_radius_normal(lat, ell);
+%! N = get_radius_normal (lat, ell);
 %! correct_answer = ell.a;
-%! myassert (N, correct_answer, -sqrt(eps));
+%! myassert (N, correct_answer, -sqrt (eps));
 
 %!test
-%! % At the north pole:
+%! ## At the north pole:
 %! lat = +90;
-%! N = get_radius_normal(lat, ell);
+%! N = get_radius_normal (lat, ell);
 %! correct_answer = ell.a^2 / ell.b;
-%! myassert (N, correct_answer, -sqrt(eps));
+%! myassert (N, correct_answer, -sqrt (eps));
 
 %!test
-%! % At the south pole:
+%! ## At the south pole:
 %! lat = -90;
-%! N = get_radius_normal(lat, ell);
+%! N = get_radius_normal (lat, ell);
 %! correct_answer = ell.a^2 / ell.b;
-%! myassert (N, correct_answer, -sqrt(eps));
-
+%! myassert (N, correct_answer, -sqrt (eps));
diff -r be0384fa4008 -r b22805479ab0 inst/get_sinefun.m
--- a/inst/get_sinefun.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/get_sinefun.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,35 +1,38 @@
-% Copyright (c) 2013, Sandeep V. Mahanthi
-% All rights reserved.
-% 
-% Redistribution and use in source and binary forms, with or without
-% modification, are permitted provided that the following conditions are
-% met:
-% 
-%     * Redistributions of source code must retain the above copyright
-%       notice, this list of conditions and the following disclaimer.
-%     * Redistributions in binary form must reproduce the above copyright
-%       notice, this list of conditions and the following disclaimer in
-%       the documentation and/or other materials provided with the distribution
-% 
-% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-% POSSIBILITY OF SUCH DAMAGE.
-function [sinfun,cosfun] = get_sinefun(angleut)
-  if strcmpi(angleut,'degree')
+## Copyright (c) 2013, Sandeep V. Mahanthi
+## All rights reserved.
+## 
+## Redistribution and use in source and binary forms, with or without
+## modification, are permitted provided that the following conditions are
+## met:
+## 
+##     * Redistributions of source code must retain the above copyright
+##       notice, this list of conditions and the following disclaimer.
+##     * Redistributions in binary form must reproduce the above copyright
+##       notice, this list of conditions and the following disclaimer in
+##       the documentation and/or other materials provided with the distribution
+## 
+## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+## POSSIBILITY OF SUCH DAMAGE.
+
+function [sinfun, cosfun] = get_sinefun (angleut)
+
+  if strcmpi (angleut, "degree")
     sinfun = @sind;
     cosfun = @cosd;
-  elseif strcmpi(angleut,'radian')
+  elseif strcmpi (angleut, "radian")
     sinfun = @sin;
     cosfun = @cos;
   else
-    error('Octave:invalid-input-arg: %s',angleut);
+    error ("invalid-input-arg: %s", angleut);
   end
+
 endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/ned2aer.m
--- a/inst/ned2aer.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/ned2aer.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -17,9 +15,9 @@
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
 
-function [az, elev, slantRange] = ned2aer(xNorth, yEast, zDown, angleut)
-  if (nargin<4)
-    angleut = 'degree';
-  endif
-  [az, elev, slantRange] = enu2aer(yEast, xNorth, -zDown, angleut);
+function [az, elev, slantRange] = ned2aer (xNorth, yEast, zDown, ...
+                                           angleut="degree")
+
+  [az, elev, slantRange] = enu2aer (yEast, xNorth, -zDown, angleut);
+
 endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/ned2ecef.m
--- a/inst/ned2ecef.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/ned2ecef.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -16,9 +14,11 @@
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
-function [x, y, z] = ned2ecef(xNorth, yEast, zDown, lat0, lon0, h0, spheroid, angleut)
-  if (nargin<8)
-    angleut = 'degree';
-  endif
-  [x, y, z] = enu2ecef(yEast, xNorth, -zDown, lat0, lon0, h0, spheroid, angleut);
-endfunction
\ No newline at end of file
+
+function [x, y, z] = ned2ecef(xNorth, yEast, zDown, lat0, lon0, h0, ...
+                     spheroid, angleut="degree")
+
+  [x, y, z] = enu2ecef (yEast, xNorth, -zDown, lat0, lon0, h0, spheroid, ...
+                        angleut);
+ 
+endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/ned2ecefv.m
--- a/inst/ned2ecefv.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/ned2ecefv.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -16,9 +14,10 @@
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
-function [u, v, w] = ned2ecefv(uNorth, vEast, wDown, lat0, lon0, angleut)
-  if (nargin<6)
-    angleut = 'degree';
-  endif
-  [u, v, w]= enu2ecefv(vEast, uNorth, -wDown, lat0, lon0, angleut);
-endfunction
\ No newline at end of file
+
+function [u, v, w] = ned2ecefv(uNorth, vEast, wDown, lat0, lon0, ...
+                     angleut="degree")
+
+  [u, v, w] = enu2ecefv (vEast, uNorth, -wDown, lat0, lon0, angleut);
+
+endfunction
diff -r be0384fa4008 -r b22805479ab0 inst/ned2geodetic.m
--- a/inst/ned2geodetic.m	Sat Mar 22 17:47:08 2014 -0700
+++ b/inst/ned2geodetic.m	Fri Mar 27 21:34:09 2015 +0100
@@ -1,7 +1,5 @@
 ## Copyright (C) 2013 Felipe G. Nievinski
 ## Copyright (C) 2013 Sandeep V. Manthi
-## 
-## This file is part of Octave.
 ##
 ## Octave is free software; you can redistribute it and/or modify it
 ## under the terms of the GNU General Public License as published by
@@ -16,13 +14,12 @@
 ## You should have received a copy of the GNU General Public License
 ## along with Octave; see the file COPYING.  If not, see
 ## <http://www.gnu.org/licenses/>.
-function [phi, lambda, h] = ned2geodetic(xNorth, yEast, zDown, lat0, lon0, h0, spheroid, angleut)
 
-  if (nargin<8)
-    angleut = 'degree';
-  endif
+function [phi, lambda, h] = ned2geodetic(xNorth, yEast, zDown, lat0, lon0, ...
+                            h0, spheroid, angleut="degree")
 
-  [x, y, z] = enu2ecefFormula(yEast, xNorth, -zDown, lat0, lon0, h0, spheroid, angleut);
-  [phi, lambda, h]=ecef2geodetic(x, y, z,spheroid,angleut);
+  [x, y, z] = enu2ecefFormula (yEast, xNorth, -zDown, lat0, lon0, h0, ...
+                               spheroid, angleut);
+  [phi, lambda, h] = ecef2geodetic (x, y, z,spheroid, angleut);
 
 endfunction
