Java Math atan() Method

Facebooktwitterredditpinterestlinkedinmailby feather

The atan() method of Math class computes the trigonometric Arc Tangent (inverse of tangent ) of an angle. The value returned is between -pi/2 to pi/2.

 Syntax:

public static double atan(double a)

Parameters:

The parameter ‘a’ represents the value whose arc tangent is to be determined.

 Return Value:

The atan() method returns the arc tangent of the argument .

  • It returns NaN, if we pass a NaN .
  • If we pass zero as an argument, it will return zero with the same sign as the argument.

Example 1:

 Output:

Example 2:

 Output:

Example 3:

 Output:

Example 4:

 Output:

Example 5:

 Output:

Example 6:

Output:

Facebooktwitterredditpinterestlinkedinmailby feather