invproj.m
来自「物流分析工具包。Facility location: Continuous mi」· M 代码 · 共 28 行
M
28 行
function XY = invproj(XY)
%INVPROJ Inverse Mercator projection.
% XY = invproj(XY)
% y = invproj(y)
% XY = two-column matrix of longitude-latitude pairs (in decimal degrees)
% y = column vector of latitudes (in decimal degrees)
%
% (Only latitudes are modified in the inverse 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.'), end
% End (Input Error Checking) **********************************************
if cXY == 2
XY(:,2) = 180*atan(sinh(pi*XY(:,2)./180))./pi;
else
XY = 180*atan(sinh(pi*XY./180))./pi;
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?