.atan()

The Math.atan() method returns the inverse tangent (or arctangent) of the argument in radians.

Syntax

Math.atan(n)

n is a double whose arctangent is returned.

Example

The following example uses Math.atan() to return the inverse tangent of 1.0:

public class Main {
public static void main(String[] args) {
double x = 1.0;
System.out.println(Math.atan(x));
// Output: 0.7853981633974483
}
}

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn Java on Codecademy