m_xydist.m
来自「m_map是加拿大学者编写的一个在matlab上绘地图的软件」· M 代码 · 共 33 行
M
33 行
function dist = m_xydist(x,y)% M_XYDIST Spherical earth distance between points in map projection coordinates. % RANGE=M_XYDIST(X,Y) gives the distance in kilometers between% successive points in the vectors X and Y which are coordinates% in the current map projection. This function is useful for finding% distances between points "picked off" a map, e.g.:%% Example:% G = GINPUT(2); km_dist = M_XYDIST(G(:,1),G(:,2));%% See also M_LLDIST% Rich Pawlowicz (rich@ocgy.ubc.ca) 6/Nov/00, based largely on an% idea by Deirdre Byrne.% This software is provided "as is" without warranty of any kind. But% it's mine, so you can't sell it.global MAP_PROJECTION MAP_VAR_LISTif isempty(MAP_PROJECTION), disp('No Map Projection initialized - call M_PROJ first!'); return;end;% get lon, lat coords[lon,lat] = m_xy2ll(x,y);dist = m_lldist(lon,lat);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?