⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 proj.m

📁 物流分析工具包。Facility location: Continuous minisum facility location, alternate location-allocation (ALA)
💻 M
字号:
function XY = proj(XY)
%PROJ Mercator projection.
%    XY = proj(XY)
%     y = proj(y)
%    XY = two-column matrix of longitude-latitude pairs (in decimal deg.)
%     y = column vector of latitudes (in decimal degrees)
%
% (Only latitudes are modified in the Mercator projection, longitudes are
%  unmodified and are not required.)
%
% (Based on Eric Weisstein's Mathworld website 
%  "http://mathworld.wolfram.com/MapProjection.html)

% Copyright (c) 1994-2006 by Michael G. Kay
% Matlog Version 9 13-Jan-2006 (http://www.ie.ncsu.edu/kay/matlog)

% Input Error Checking ****************************************************
cXY = size(XY,2);
if cXY > 2
   error('Input must be two-column matrix or column vector.')
elseif cXY == 2 && any(XY(:,1) < -180 | XY(:,1) > 180)
   error('Longitudes in XY(:,1) must be between -180 and 180 degrees.')
elseif (cXY == 1 && any(XY < -90 | XY > 90)) || ...
      (cXY == 2 && any(XY(:,2) < -90 | XY(:,2) > 90))
   error('Latitudes in XY must be between -90 and 90 degrees.')
end
% End (Input Error Checking) **********************************************

if cXY == 2
   XY(:,2) = 180*asinh(tan(pi*XY(:,2)./180))./pi;
else
   XY = 180*asinh(tan(pi*XY./180))./pi;
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -