Changeset 22758 for issm/trunk/src/m/coordsystems/xy2ll.m
- Timestamp:
- 05/10/18 10:24:27 (7 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:mergeinfo changed
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/m/coordsystems/xy2ll.m
r21341 r22758 1 function [lat,lon ] = xy2ll(x,y,sgn,central_meridian,standard_parallel)1 function [lat,lon,scale_factor] = xy2ll(x,y,sgn,central_meridian,standard_parallel) 2 2 %XY2LL - converts xy to lat long 3 3 % … … 5 5 % latitude and longitude Stereographic (X,Y) coordinates for the polar 6 6 % regions. 7 % Optional scale factor provides the scaling factor needed to correct projection error 8 % in areas and volumes 7 9 % Author: Michael P. Schodlok, December 2003 (map2xy.m) 8 10 % 9 11 % Usage: 10 12 % [lat,lon] = xy2ll(x,y,sgn); 13 % [lat,lon,scale_factor] = xy2ll(x,y,sgn); 11 14 % [lat,lon] = xy2ll(x,y,sgn,central_meridian,standard_parallel); 12 15 % … … 29 32 end 30 33 else 34 help xy2ll 35 error('bad usage'); 36 end 37 38 if nargout~=3 & nargout~=2, 31 39 help xy2ll 32 40 error('bad usage'); … … 64 72 [res1,res2] = find(rho(:) <= 0.1); 65 73 if res1 66 lat(res1) = 90. * sgn;74 lat(res1) = pi/2. * sgn; 67 75 lon(res1) = 0.0; 68 76 end … … 71 79 lat = lat * 180. / pi; 72 80 lon = lon - delta; 81 if nargout==3, 82 m=((1+sin(abs(slat)*pi/180))*ones(length(lat),1)./(1+sin(abs(lat)*pi/180))); 83 scale_factor=(1./m).^2; 84 end
Note:
See TracChangeset
for help on using the changeset viewer.