来一个方位角的自定义函数
Private Function fwj(ByVal X As Double, ByVal Y As Double, ByVal z As Double, ByVal l As Double) As Double
A = z - X
b = l - Y
If A = 0 Then A = 0.000000000001
c = Atn(b / A)
If A < 0 Then fwj = c + PI
If A > 0 And b < 0 Then fwj = c + 2 * PI
If A > 0 And b >= 0 Then fwj = c
End Function |