Public Sub sdk_SDK_ReceiveMessage(ByVal sender As Object, ByVal fe As NullStudio.Fetion_SDK.Event.SDK_ReceiveMessageEventArgs) Me.TextBox_ReceiveMessage.Text = Me.TextBox_ReceiveMessage.Text & _ fe.Contact.DisplayName & vbCrLf & _ " " & fe.Message & vbCrLf End Sub
Public Function P2P_Angle(ByVal PT1 As Point3d, ByVal PT2 As Point3d) As Double 'Pt1为坐标原点 Dim DX As Double Dim DY As Double DX = PT1.X - PT2.X DY = PT1.Y - PT2.Y Dim A45 As Double = Math.Atan(1) '45度角 If DX = 0 Then '垂直线 If DY < 0 Then P2P_Angle1 = A45 * 2 '90度 P2P_Angle1 = A45 * 6 '270 End If ElseIf DX < 0 Then If DY <= 0 Then P2P_Angle1 = Math.Atan(DY / DX) '第一象限(包含x轴正方向0度) Else P2P_Angle1 = A45 * 8 - Math.Atan(-DY / DX) '第四象限 End If ElseIf DX > 0 Then P2P_Angle1 = Math.Atan(DY / DX) + A45 * 4 '第二、第三象限(包含x轴负方向180度) End If End Function