Home » Java Math.tan() Method with Examples

Java Math.tan() Method with Examples

by Online Tutorials Library

Java Math.tan() method

The java.lang.Math.tan() is used to return the trigonometric tangent of an angle.

Syntax

Parameter

Return

  • If the argument is positive or negative number, this method will return the Tangent value.
  • If the argument is NaN or infinity, this method will return NaN.
  • If the argument is zero, this method will return zero with the same sign as the argument.

Example 1

Test it Now

Output:

0.9999999999999999  

Example 2

Test it Now

Output:

1.7320508075688767  

Example 3

Test it Now

Output:

NaN  

Next TopicJava Math

You may also like