The android document explains math. atan2 as follows:
Double java. Lang. Math. atan2 (Double X, Double Y)
Public static double atan2 (Double X, Double Y)
Since: API Level 1
Returns the closest double approximation of the arc tangent of Y/X within the range [-Pi .. pi]. this is the angle of the polar representation of the rectangular coordinates (x, y ). the returned result is within 2 ulps (units in the last place) of the real result.
The returned result is equivalent to the angle corresponding to the point (the first parameter X and the second parameter Y), corresponding to the value of Y/X.
But none of them are correct. Especially when the symbols X and Y are not at the same time.
Following the instructions in jdk1.6, the returned result is equivalent to the angle (second parameter, first parameter.
Double java. Lang. Math. atan2 (Double Y, double X)
Public static double atan2 (Double Y, double X)
Returns the angle Theta from the conversion of rectangular coordinates (x, y) to polar coordinates (R, theta ). this method computes the phase theta by computing an arc tangent of Y/X in the range of-pi to pi. special cases:
If either argument is Nan, then the result is Nan.
In JDK.
This error exists in the android document, and the same effect is achieved with the android SDK.