Function Ugao(IDL As Integer, IDT As Integer, Optional Kontra As Boolean) Dim Dx As Double Dim DY As Double Dim U As Double Dim K As Boolean Kor Dx, DY, IDL, IDT, K If K = False Then GoTo Kraj If Dx = 0 Or DY = 0 Then GoTo Kraj U = Atn(Abs(DY) / Abs(Dx)) If Dx < 0 Then If DY < 0 Then U = Abs(U) + PI Else U = PI - Abs(U) End If Else If DY < 0 Then U = (2 * PI) - Abs(U) End If End If U = RadDeg(U) If Kontra = True Then If U > 180 Then U = U - 180 ElseIf Ugao < 180 Then U = U + 180 End If End If Ugao = Format(U, "0.00") Kraj: End Function