如果没记错公式,应该是这样
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)