I am looking for the math that performs the same thing as the ATAN2 function used in Excell. The problem is, in VB the only function available is ATAN.
Anyones help would be greatly appreciated.
Ron
Printable View
I am looking for the math that performs the same thing as the ATAN2 function used in Excell. The problem is, in VB the only function available is ATAN.
Anyones help would be greatly appreciated.
Ron
ATAN2(x,y) is the same thing as ATAN(y/x).
Code:If X Then
Atan2 = Atn(Y / X) - (X > 0) * 3.14159265358979
Else
Atan2 = 1.5707963267949 + (Y > 0) * 3.14159265358979
End If