mapll

PURPOSE ^

MAPLL - convert latitude and longitude into x and y

SYNOPSIS ^

function [x,y]=mapll(alat,alon,hem);

DESCRIPTION ^

MAPLL - convert latitude and longitude into x and y

   latitude and longitude are in degrees.
   Hemisphere must be 1 for north and 0 for south

   Usage:
      [x,y]=mapll(latitude,longitude,hemisphere)

   See also MAPXY, LL2XY

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function  [x,y]=mapll(alat,alon,hem);
0002 %MAPLL - convert latitude and longitude into x and y
0003 %
0004 %   latitude and longitude are in degrees.
0005 %   Hemisphere must be 1 for north and 0 for south
0006 %
0007 %   Usage:
0008 %      [x,y]=mapll(latitude,longitude,hemisphere)
0009 %
0010 %   See also MAPXY, LL2XY
0011 
0012 re=6378137.0; 
0013 e2= 0.00669437999015;
0014 
0015 e=sqrt(e2);
0016 
0017 %Standard parallel - latitude with no distortion = -71.
0018 slat=71;
0019 sn=-1.0;
0020 xlam=0;
0021 
0022 if hem==1,
0023    xlam=45;
0024     sn=1;
0025     slat=70;
0026 end
0027 
0028 alat=sn*alat;
0029 alon=sn*alon;
0030 alat=alat/180*pi;
0031 alon=alon/180*pi;
0032 
0033 rlat=alat;
0034 slat=slat/180*pi;
0035 xlam=xlam/180*pi;
0036 
0037 t1=tan(pi/4.-rlat/2.)./((1.0-e*sin(rlat))./...
0038 (1.0+e*sin(rlat))).^(e/2.);
0039 
0040 t2=tan(pi/4.-slat/2.)./((1.0-e*sin(slat))./...
0041 (1.0+e*sin(slat))).^(e/2.);
0042 
0043 cm=cos(slat)./sqrt(1.0-e2*(sin(slat).^2));
0044 rho=re*cm.*t1./t2;
0045 x= rho*sn.*sin((alon+xlam));
0046 y=-rho*sn.*cos((alon+xlam));

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003