Home > atmlab > geodetic > ellipsoidcurvradius.m

ellipsoidcurvradius

PURPOSE ^

ELLIPSOIDCURVRADIUS Sets ellispoid to local curvature radius

SYNOPSIS ^

function ellipsoid = ellipsoidcurvradius(ellipsoid,lat_gd,azimuth)

DESCRIPTION ^

 ELLIPSOIDCURVRADIUS   Sets ellispoid to local curvature radius

    Calculates the curvature radius for the given latitude and azimuth
    angle, and uses this to set a spherical reference ellipsoid
    suitable for 1D calculations. The curvature radius is a better
    local approximation than using the local ellipsoid radius.

    The calculation expressions are taken from radiigeo.pdf, found in the
    same folder as this function.

    For exact result the geoDETIC latitude shall be used. 

 FORMAT   ellipsoid = ellipsoidcurvradius( ellipsoid, lat_gd, azimuth )
    
 OUT   ellipsoid  Modified ellipsoid.
 IN    ellipsoid  Model ellipsoid as returned by *ellipsoidmodels*.
       lat_gd     Geodetic latitude.
       azimuth    Azimuthal angle (angle from NS plane). If given curvature
                  radii are returned, see above

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

ellipsoidcurvradius.m

SOURCE CODE ^

0001 % ELLIPSOIDCURVRADIUS   Sets ellispoid to local curvature radius
0002 %
0003 %    Calculates the curvature radius for the given latitude and azimuth
0004 %    angle, and uses this to set a spherical reference ellipsoid
0005 %    suitable for 1D calculations. The curvature radius is a better
0006 %    local approximation than using the local ellipsoid radius.
0007 %
0008 %    The calculation expressions are taken from radiigeo.pdf, found in the
0009 %    same folder as this function.
0010 %
0011 %    For exact result the geoDETIC latitude shall be used.
0012 %
0013 % FORMAT   ellipsoid = ellipsoidcurvradius( ellipsoid, lat_gd, azimuth )
0014 %
0015 % OUT   ellipsoid  Modified ellipsoid.
0016 % IN    ellipsoid  Model ellipsoid as returned by *ellipsoidmodels*.
0017 %       lat_gd     Geodetic latitude.
0018 %       azimuth    Azimuthal angle (angle from NS plane). If given curvature
0019 %                  radii are returned, see above
0020 
0021 % 2011-11-14   Created by Patrick Eriksson.
0022 
0023 
0024 function ellipsoid = ellipsoidcurvradius(ellipsoid,lat_gd,azimuth)
0025 
0026 % Check input                                                          %&%
0027 rqre_datatype( ellipsoid, @isvector );                                 %&%
0028 if length(ellipsoid) ~= 2                                              %&%
0029  error( 'The argument *ellipsoid* must be a vector of length 2' );     %&%
0030 end                                                                    %&%
0031 rqre_in_range( ellipsoid(2), 0, 1, 'element 2 of ellipsoid' );         %&%
0032 rqre_datatype( lat_gd, @isscalar );                                    %&%
0033 rqre_datatype( azimuth, @isscalar );                                   %&%
0034 
0035 
0036 % If spherical, nothng to do
0037 if ellipsoid(2) > 0
0038   %
0039   e2    = ellipsoid(2)^2;
0040   aterm = 1 - e2 * sind(lat_gd).^2;
0041   %
0042   rn = 1 ./ sqrt(aterm);
0043   rm = (1-e2) * (rn ./ aterm );
0044   %
0045   ellipsoid(1) = ellipsoid(1) ./ ( cosd(azimuth)^2./rm + sind(azimuth)^2./rn );
0046   ellipsoid(2) = 0;
0047 end

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005