| 查看: 1203 | 回复: 3 | ||
[求助]
matlab 编程求北京到纽约的距离和方位角 已有3人参与
|
| matlab 编程求北京到纽约的距离和北京到纽约的方位角和纽约到北京的方位角 |
» 猜你喜欢
香港中文大学(深圳)2025年招聘简章
已经有2人回复
城乡规划学招收调剂 1名
已经有0人回复
地球物理学和空间物理学论文润色/翻译怎么收费?
已经有187人回复
长江大学石油工程学院有调剂名额
已经有1人回复
长江大学石油工程学院有调剂名额
已经有0人回复
地区已中,感谢虫友们!
已经有109人回复
【招聘】科研助理+五险一金
已经有19人回复
» 本主题相关价值贴推荐,对您同样有帮助:
求matlab编程代码,求帮助,谢谢!
已经有11人回复
matlab如何编程由因变量求解自变量
已经有5人回复
matlab动力学模型编程求助
已经有6人回复
matlab非线性方程组该如何编程。求助
已经有10人回复
匈牙利算法的matlab编程求助
已经有6人回复
求助:遗传算法的matlab编程求解资源优化问题
已经有7人回复
隐函数积分问题的matlab编程求助
已经有3人回复
哪位高手能用matlab编程求解一维瞬态热传导方程,先谢谢啦
已经有7人回复
分数阶微分方程的求解(用差分法,matlab编程求解)
已经有9人回复
急求一本matlab面向对象编程的书籍,针对2012版本的matlab
已经有3人回复
求既懂数学又懂matlab编程的虫友有偿编程
已经有7人回复
用MATLAB编程求复数四次方程
已经有5人回复
matlab 编程计算有一步不明白,求解答
已经有4人回复
MATLAB 编程求解普通实验数据时间序列的最大李雅普诺夫指数!!!
已经有12人回复
求高人指点 MATLAB 编程求解 洛伦兹的最大李雅普诺夫指数程序!!!!
已经有5人回复
100BB急求matlab编程中的问题解决,如何修改这个程序呢?
已经有4人回复
求助matlab编程
已经有13人回复
求助:matlab编程求解变管径流场问题?
已经有6人回复
【求助】能够取代Matlab的类似仿真工具(最好编程语言相差不大)
已经有9人回复
【求助】用MATLAB编程求级数的和
已经有16人回复
2楼2014-10-24 13:39:59
【答案】应助回帖
|
计算距离的,方位角的再找找看吧,或者代码稍微修改下 ========================= function dist = pos2dist(lag1,lon1,lag2,lon2,method) % function dist = pos2dist(lag1,lon1,lag2,lon2,method) % calculate distance between two points on earth's surface % given by their latitude-longitude pair. % Input lag1,lon1,lag2,lon2 are in degrees, without 'NSWE' indicators. % Input method is 1 or 2. Default is 1. % Method 1 uses plane approximation, % only for points within several tens of kilometers (angles in rads): % d = % sqrt(R_equator^2*(lag1-lag2)^2 + R_polar^2*(lon1-lon2)^2*cos((lag1+lag2)/2)^2) % Method 2 calculates sphereic geodesic distance for points farther apart, % but ignores flattening of the earth: % d = % R_aver * acos(cos(lag1)cos(lag2)cos(lon1-lon2)+sin(lag1)sin(lag2)) % Output dist is in km. % Returns -99999 if input argument(s) is/are incorrect. % Flora Sun, University of Toronto, Jun 12, 2004. if nargin < 4 dist = -99999; disp('Number of input arguments error! distance = -99999'); return; end if abs(lag1)>90 | abs(lag2)>90 | abs(lon1)>360 | abs(lon2)>360 dist = -99999; disp('Degree(s) illegal! distance = -99999'); return; end if lon1 < 0 lon1 = lon1 + 360; end if lon2 < 0 lon2 = lon2 + 360; end % Default method is 1. if nargin == 4 method = 1; end if method == 1 km_per_deg_la = 111.3237; km_per_deg_lo = 111.1350; km_la = km_per_deg_la * (lag1-lag2); % Always calculate the shorter arc. if abs(lon1-lon2) > 180 dif_lo = abs(lon1-lon2)-180; else dif_lo = abs(lon1-lon2); end km_lo = km_per_deg_lo * dif_lo * cos((lag1+lag2)*pi/360); dist = sqrt(km_la^2 + km_lo^2); else R_aver = 6374; deg2rad = pi/180; lag1 = lag1 * deg2rad; lon1 = lon1 * deg2rad; lag2 = lag2 * deg2rad; lon2 = lon2 * deg2rad; dist = R_aver * acos(cos(lag1)*cos(lag2)*cos(lon1-lon2) + sin(lag1)*sin(lag2)); end |

3楼2014-12-10 10:32:07
4楼2015-02-23 00:02:46












回复此楼