Foxtable(狐表)用户栏目专家坐堂 → [求助]数值计算问题


  共有3632人关注过本帖树形打印复制链接

主题:[求助]数值计算问题

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/6/12 18:08:00 [显示全部帖子]

如果没记错公式,应该是这样

 

Dim x1 As Double = 1
Dim y1 As Double = 1
Dim x2 As Double = 2
Dim y2 As Double = 2

Dim rad As Double = 6371
Dim p1X As Double = X1 / 180 * Math.PI
Dim p1Y As Double = Y2 / 180 * Math.PI
Dim p2X As Double = X2 / 180 * Math.PI
Dim p2Y As Double = Y2 / 180 * Math.PI
Dim result As Double = Math.Acos(Math.Sin(p1Y) * Math.Sin(p2Y) + Math.Cos(p1Y) * Math.Cos(p2Y) * Math.Cos(p2X - p1X)) * rad
msgbox(result)


 回到顶部