Home > atmlab > geodetic > geodetic2geocentric.m

geodetic2geocentric

PURPOSE ^

GEODETIC2GEOCENTRIC converts from a geodetic to a geocentric position

SYNOPSIS ^

function [r_gc,lat_gc,lon_gc]=geodetic2geocentric(h,lat_gd,lon_gd,ellipsoid)

DESCRIPTION ^

 GEODETIC2GEOCENTRIC converts from a geodetic to a geocentric position
  
   The geodetic coordinates refer to the reference ellipsoid 
   specified by input ellipsoid. 
   See Contents for a defintion of the geocentric coordinate system.

 FORMAT [r,lat_gc,lon_gc]=geodetic2geocentric(h,lat_gd,lon_gd[,ellipsoid])

 OUT    r         Radius
        lat_gc    Geocentric latitude
        lon_gc    Geocentric longitude

 IN     h         Geodetic height (height above the reference ellipsoid)
        lat_gd    Geodetic latitude
        lon_gd    geodetic longitude
 OPT    ellipsoid a row vector with the form [semimajor axis, eccentricity]
                  specifying the ellipsoid,
                  the semimajor axis must use the same units as h  
        Default is WGS84.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

geodetic2geocentric.m

SOURCE CODE ^

0001 % GEODETIC2GEOCENTRIC converts from a geodetic to a geocentric position
0002 %
0003 %   The geodetic coordinates refer to the reference ellipsoid
0004 %   specified by input ellipsoid.
0005 %   See Contents for a defintion of the geocentric coordinate system.
0006 %
0007 % FORMAT [r,lat_gc,lon_gc]=geodetic2geocentric(h,lat_gd,lon_gd[,ellipsoid])
0008 %
0009 % OUT    r         Radius
0010 %        lat_gc    Geocentric latitude
0011 %        lon_gc    Geocentric longitude
0012 %
0013 % IN     h         Geodetic height (height above the reference ellipsoid)
0014 %        lat_gd    Geodetic latitude
0015 %        lon_gd    geodetic longitude
0016 % OPT    ellipsoid a row vector with the form [semimajor axis, eccentricity]
0017 %                  specifying the ellipsoid,
0018 %                  the semimajor axis must use the same units as h
0019 %        Default is WGS84.
0020 
0021 % History: created by Bengt Rydberg 2011-10-31
0022 function [r_gc,lat_gc,lon_gc]=geodetic2geocentric(h,lat_gd,lon_gd,ellipsoid)
0023 
0024 if nargin<4
0025   %WGS84 reference ellipsoid
0026   ellipsoid = ellipsoidmodels( 'WGS84' );
0027 end 
0028 
0029 [x,y,z]              = geodetic2cart(h,lat_gd,lon_gd, ellipsoid );
0030 
0031 [r_gc,lat_gc,lon_gc] = cart2geocentric(x,y,z);
0032 
0033

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