java tutorial - Java Math.atan() Method - java programming - learn java - java basics - java for beginners



Java numbers atan

Learn Java - Java tutorial - Java numbers atan - Java examples - Java programs

Description

Method Math.atan () — returns the arc tangent of the radian value.

Syntax

double atan(double d)
click below button to copy the code. By - java tutorial - team

Options

Detailed information about the parameters:

  • d is the double data type.

Return value

  • In Java, Math.atan () returns the arc tangent of the double value specified in radians.

Sample Code

public class Test { 

   public static void main(String args[]) {
      double degrees = 65.0;
      double radians = Math.toRadians(degrees);

      System.out.format("The value of pi is very approximately %.4f%n", Math.PI);
      System.out.format("The arctangent of %.4f is %.4f degrees %n", Math.cos(radians), 
         Math.toDegrees(Math.atan(Math.sin(radians))));
   }
}
click below button to copy the code. By - java tutorial - team

Output

The value of pi is  very approximately 3.1416
The arctangent of 0.4226 is 42.1863 degrees 

Table of the main values of the arc tangent:

 atan table

Learn java - java tutorial - arctan table - java examples - java programs


Related Searches to Java Math.atan() Method