Changeset 2271 for issm/trunk/src/m/utils/LatLong/mapll.m
- Timestamp:
- 09/22/09 13:38:39 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/m/utils/LatLong/mapll.m
r2079 r2271 1 function [x,y]=mapll(lat,lon,hem );1 function [x,y]=mapll(lat,lon,hem,varargin); 2 2 %MAPLL - convert latitude and longitude into x and y 3 3 % … … 10 10 % See also MAPXY, LL2XY 11 11 12 %check number of arguments. 13 if ~((nargin==3) | (nargin==5)), 14 mapllerrorusage(); 15 end 16 17 %hem: must be either 's' or 'n' 18 if ~ischar(hem), 19 error('mapll error message: hemisphere argument should be ''n'' or ''s'''); 20 end 21 22 %check hem is either 'n' or 's': 23 if ~(hem=='s' | hem=='n'), 24 error('mapll error message: hem should be ''s'' or ''n'''); 25 end 26 27 %set sn: 28 if hem=='s', 29 slat=71; 30 sn=-1.0; 31 xlam=0; 32 else 33 slat=70; 34 sn=1.0; 35 xlam=45; 36 end 37 38 %set defaults for standard parallels and centre meridians. 39 if nargin==5, 40 slat=varargin{1}; 41 xlam=varargin{2}; 42 end 43 44 12 45 %some corrections 13 46 lon=lon+360; % to have 0<lon<360 … … 17 50 e2= 0.00669437999015; 18 51 e=sqrt(e2); 19 20 %Standard parallel - latitude with no distortion = -71.21 if hem==1,22 %Northern hemisphere23 sn=1;24 slat=70;25 xlam=45;26 else27 %Southern Hemisphere28 sn=-1.0;29 slat=71;30 xlam=0;31 end32 52 33 53 lat=sn*lat*pi/180; … … 48 68 x= rho*sn.*sin((lon+xlam)); 49 69 y=-rho*sn.*cos((lon+xlam)); 70 71 end 72 73 function mapllerrorusage(), 74 help mapll 75 end
Note:
See TracChangeset
for help on using the changeset viewer.