VOOZH about

URL: https://www.geeksforgeeks.org/java/java-lang-math-atan2-java/

⇱ java.lang.Math.atan2() in Java - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

java.lang.Math.atan2() in Java

Last Updated : 20 Jun, 2021

atan2() is an inbuilt method in Java that is used to return the theta component from the polar coordinate. The atan2() method returns a numeric value between -and representing the angle of a (x, y) point and the positive x-axis. It is the counterclockwise angle, measured in radian, between the positive X-axis, and the point (x, y). 
Syntax : 
 

Math.atan2(double y, double x)
where, x and y are X and Y coordinates in double data type.


Returns : 
It returns a double value. The double value is from polar coordinate (r, theta). 
Example: Program demonstrating the atan2() method 
 


Output
0.16514867741462683
Comment
Article Tags: