Changeset 2079


Ignore:
Timestamp:
09/02/09 09:55:01 (16 years ago)
Author:
Mathieu Morlighem
Message:

Readded ll2xy: results differ from mapll... to be investigated

Location:
issm/trunk/src/m/utils/LatLong
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/utils/LatLong/mapll.m

    r1 r2079  
    1 function  [x,y]=mapll(alat,alon,hem);
     1function  [x,y]=mapll(lat,lon,hem);
    22%MAPLL - convert latitude and longitude into x and y
    33%
     
    1010%   See also MAPXY, LL2XY
    1111
    12 re=6378137.0;
     12%some corrections
     13lon=lon+360;       % to have 0<lon<360
     14
     15%WGS84
     16re=6378137.0;
    1317e2= 0.00669437999015;
    14 
    1518e=sqrt(e2);
    1619
    1720%Standard parallel - latitude with no distortion = -71.
    18 slat=71;
    19 sn=-1.0;
    20 xlam=0;
    21 
    2221if hem==1,
    23    xlam=45;
     22        %Northern hemisphere
    2423        sn=1;
    2524        slat=70;
     25        xlam=45;
     26else
     27        %Southern Hemisphere
     28        sn=-1.0;
     29        slat=71;
     30        xlam=0;
    2631end
    2732
    28 alat=sn*alat;
    29 alon=sn*alon;
    30 alat=alat/180*pi;
    31 alon=alon/180*pi;
     33lat=sn*lat*pi/180;
     34lon=lon*pi/180;
    3235
    33 rlat=alat;
     36rlat=lat;
    3437slat=slat/180*pi;
    3538xlam=xlam/180*pi;
     
    4346cm=cos(slat)./sqrt(1.0-e2*(sin(slat).^2));
    4447rho=re*cm.*t1./t2;
    45 x= rho*sn.*sin((alon+xlam));
    46 y=-rho*sn.*cos((alon+xlam));
     48x= rho*sn.*sin((lon+xlam));
     49y=-rho*sn.*cos((lon+xlam));
Note: See TracChangeset for help on using the changeset viewer.