fwj(Xa-Xb,YA-YB)-fwj(...)
再判断下大小180度就是了。
Public Function fwj(ByVal x As Double, ByVal y As Double) As Double If x = 0 Then If y > 0 Then fwj = 3.14159265358979 / 2 Else fwj = 3.14159265358979 * 1.5 End If Else fwj = Atn(y / x) If x > 0 And y > 0 Then fwj = fwj If x > 0 And y <= 0 Then fwj = 2 * 3.14159265358979 + fwj If x < 0 Then fwj = fwj + 3.14159265358979 End If End Function |