java.lang.Math.atan2() in Java Last Updated : 20 Jun, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report 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 -\pi and \pi representing the angle \theta 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 \theta from polar coordinate (r, theta). Example: Program demonstrating the atan2() method Java // Java program for implementation of // atan2() method import java.util.*; class GFG { // Driver Code public static void main(String args[]) { // X and Y coordinates double x = 90.0; double y = 15.0; // theta value from polar coordinate (r, theta) double theta = Math.atan2(y, x); System.out.println(theta); } } Output0.16514867741462683 Comment More infoAdvertise with us Next Article StrictMath atan() Method in Java S Striver Follow Improve Article Tags : Misc Java Java-lang package Practice Tags : JavaMisc Similar Reads Java.lang.Math Class in Java | Set 2 Java.lang.Math Class in Java | Set 1 More Methods: cosh() : java.lang.Math.cosh() method returns the hyperbolic cosine of the argument passed. Special cases : Result is NaN, if argument is NaN. Result is 1.0, if the argument is zero. Result is +ve infinity, if argument is infinite. Syntax: public st 6 min read Java.lang.StrictMath class in Java | Set 1 StrictMath Class methods helps to perform the numeric operations like square, square root, cube, cube root, exponential and trigonometric operations Declaration : public final class StrictMath extends Object NaN argument?A constant holding a Not-a-Number (NaN) value of type double. It is equivalent 8 min read Java.lang.StrictMath class in Java | Set 2 Java.lang.StrictMath Class in Java | Set 1More methods of java.lang.StrictMath class 13. exp() : java.lang.StrictMath.exp(double arg) method returns the Eulerâs number raised to the power of double argument. Important cases: Result is NaN, if argument is NaN.Result is +ve infinity, if the argument i 6 min read StrictMath atan() Method in Java The java.lang.StrictMath.atan() is an inbuilt method of StrictMath class which is used to return the tangent of a given argument. It returns the angle is within the range of -pi/2 and pi/2. It gives rise to two special results: The output is NaN if the passed parameter is a NaN. If the passed argume 2 min read JavaScript Math atan2() Method Javascript Math.atan2() method is used to return the arctangent of the quotient of its arguments. The Math.atan2() method returns a numeric value between -Î and Î representing the angle theta of an (x, y) point and the positive x-axis. This is the counterclockwise angle, measured in radians, between 1 min read JavaScript Math atan() Method Javascript Math.atan( ) method is used to return the arctangent of a number in radians. The Math.atan() method returns a numeric value between -pi/2 and pi/2 radians. The atan() is a static method of Math, therefore, it is always used as Math.atan(), rather than as a method of a Math object created. 3 min read Like