java.lang.Math.atan2(double y,double x)


java.lang.Math.atan2(double y,double x)

package com.codingdict;



import java.lang.*;



public class MathDemo {



   public static void main(String[] args) {



      // get a variable x which is equal to PI/2

      double x = Math.PI / 2;



      // get a variable y which is equal to PI/3

      double y = Math.PI / 3;



      // convert x and y to degrees

      x = Math.toDegrees(x);

      y = Math.toDegrees(y);



      // get the polar coordinates

      System.out.println("Math.atan2(" + x + "," + y + ")=" + Math.atan2(x, y));

   }

}