An error in Java. Lang. Math. atan2 In the android document

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.