Imports System.IO Module Module1 Sub Main() Dim fs As New FileStream("DATA1.txt", FileMode.Open, FileAccess.Read) Dim fso As New FileStream("OUT1.txt", FileMode.Create, FileAccess.Write) Dim text As New StreamReader(fs) Dim texto As New StreamWriter(fso) Dim line As String Dim length(2) As Double Dim x, y, c, a, b As Decimal Dim angle, values As Double Dim num(3) As String line = text.ReadLine num = line.Split(" ") length(0) = Math.Sqrt((Val(num(0)) * Val(num(0))) + (Val(num(1)) * Val(num(1)))) length(1) = Math.Sqrt((Val(num(2)) * Val(num(2))) + (Val(num(3)) * Val(num(3)))) x = Val(num(0)) - Val(num(2)) y = Val(num(1)) - Val(num(3)) length(2) = Math.Sqrt((x * x) + (y * y)) c = length(0) a = length(2) b = length(1) values = Math.Acos(((c * c) + (b * b) - (a * a)) / (2 * b * c)) angle = (values * 180) / Math.PI If num(1) = 0 Then angle = 360 - angle End If texto.WriteLine(FormatNumber(angle, 1) & vbCr) texto.Close() text.Close() fs.Close() fso.Close() End Sub End Module