I've an array with values, I need to calculate the angle between them, like in picture, assuming the increment of x is always 1
So i tryed:
Some data for the arrays:Code:Const Rad2Deg As Double = 180.0 / Math.PI Const Deg2Rad As Double = Math.PI / 180.0 Dim newlist As New List(Of UShort) For i = 0 To MySourceArray.Length - 1 Step 1 Dim first As UShort = MySourceArray(i) Dim second As UShort = MySourceArray(i + 1) Dim angle = Math.Atan2(first - second, 1) * Rad2Deg newlist.Add(angle) Nextbut I get overflow exception at the line where Atan2 is calculated. But if I try to do the the calc manually the result seem ok.Code:&H2020,&H 4544,&H4331,&H372E,&H434F,&H4D20,&H2020,&H2020
What am I missing?




Reply With Quote
