Android Question Atan2 backwards

Raywingit

Member
Licensed User
Longtime User
Atan2 calculates (X,Y) instead of (Y,X) which appears to be a B4A bug in ver.5.80
This is compared to same function in Excel
Best way to handle this would be a note in function info, since changing it
would probably cause some grief.
Found this while converting a program from (Excel+VBA) to B4A.
 

Raywingit

Member
Licensed User
Longtime User
In B4A I get : Atan(1 / 2) = 0.4636 = Atan2 (1, 2)
But in Excel: Atan(1/2) = 0.4636 and Atan2(1,2) = 1.1071

It may be that neither is wrong, but they are different. In Excel Atan2(2,1) = 0.4636.
 
Upvote 0
Top