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.


public static double atan(double a)


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:


Example 2:


Example 3:


Example 4:


Example 5:


Example 6:


Pin It on Pinterest

Share This