Changeset 2079
- Timestamp:
- 09/02/09 09:55:01 (16 years ago)
- 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);1 function [x,y]=mapll(lat,lon,hem); 2 2 %MAPLL - convert latitude and longitude into x and y 3 3 % … … 10 10 % See also MAPXY, LL2XY 11 11 12 re=6378137.0; 12 %some corrections 13 lon=lon+360; % to have 0<lon<360 14 15 %WGS84 16 re=6378137.0; 13 17 e2= 0.00669437999015; 14 15 18 e=sqrt(e2); 16 19 17 20 %Standard parallel - latitude with no distortion = -71. 18 slat=71;19 sn=-1.0;20 xlam=0;21 22 21 if hem==1, 23 xlam=45; 22 %Northern hemisphere 24 23 sn=1; 25 24 slat=70; 25 xlam=45; 26 else 27 %Southern Hemisphere 28 sn=-1.0; 29 slat=71; 30 xlam=0; 26 31 end 27 32 28 alat=sn*alat; 29 alon=sn*alon; 30 alat=alat/180*pi; 31 alon=alon/180*pi; 33 lat=sn*lat*pi/180; 34 lon=lon*pi/180; 32 35 33 rlat= alat;36 rlat=lat; 34 37 slat=slat/180*pi; 35 38 xlam=xlam/180*pi; … … 43 46 cm=cos(slat)./sqrt(1.0-e2*(sin(slat).^2)); 44 47 rho=re*cm.*t1./t2; 45 x= rho*sn.*sin(( alon+xlam));46 y=-rho*sn.*cos(( alon+xlam));48 x= rho*sn.*sin((lon+xlam)); 49 y=-rho*sn.*cos((lon+xlam));
Note:
See TracChangeset
for help on using the changeset viewer.