Changeset 22339
- Timestamp:
- 01/05/18 14:45:40 (7 years ago)
- Location:
- issm/trunk-jpl/src/m/coordsystems
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/coordsystems/ll2xy.m
r21041 r22339 1 function [x,y ] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel)1 function [x,y,scale_factor] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel) 2 2 %LL2XY - converts lat long to polar stereographic 3 3 % 4 4 % Converts from geodetic latitude and longitude to Polar 5 5 % Stereographic (X,Y) coordinates for the polar regions. 6 % Optional scale factor provides the scaling factor needed to correct projection error 7 % in areas and volumes 6 8 % Author: Michael P. Schodlok, December 2003 (map2ll) 7 9 % 8 10 % Usage: 9 11 % [x,y] = ll2xy(lat,lon,sgn) 12 % [x,y,scale_factor] = ll2xy(lat,lon,sgn) 10 13 % [x,y] = ll2xy(lat,lon,sgn,central_meridian,standard_parallel) 11 14 % … … 29 32 else 30 33 help ll2xy 34 error('bad usage'); 35 end 36 37 if nargout~=3 & nargout~=2, 38 help xy2ll 31 39 error('bad usage'); 32 40 end … … 65 73 y(cnt1) = 0.0; 66 74 end 75 76 if nargout==3, 77 m=((1+sin(abs(slat)*pi/180))*ones(length(lat),1)./(1+sin(abs(lat)*pi/180))); 78 scale_factor=(1./m).^2; 79 end -
issm/trunk-jpl/src/m/coordsystems/xy2ll.m
r21041 r22339 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'); … … 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.