i am using atan2 function but i am doubt it is not giving correct..
the code which i used ..
If y > 0 Then
If x >= y Then
Atan21 = Atn(y / x)
ElseIf x <= -y Then
Atan21 = Atn(y / x) + Pi
Else
Atan21 = Pi / 2 - Atn(x / y)
End If
Else
If x >= -y Then
Atan21 = Atn(y / x)
ElseIf x <= y Then
Atan21 = Atn(y / x) - Pi
Else
Atan21 = -Atn(x / y) - Pi / 2
End If
End If