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



Java numbers tan

Learn Java - Java tutorial - Java numbers tan - Java examples - Java programs

Description

Java Math.tan() Method - returns the tangent of the radian value.

Syntax

double tan(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.tan () returns the tangent of the double value specified in radians.

Sample Code

public class Mathtan {

   public static void main(String[] args) {

      // get two double numbers numbers
      double a = 65;
      double b = 80;

      // convert them in radians
      a = Math.toRadians(a);
      b = Math.toRadians(b);

      // print the tangent of these doubles
      System.out.println("Math.tan(" + a + ")=" + Math.tan(a));
      System.out.println("Math.tan(" + b + ")=" + Math.tan(b));
   }
}
click below button to copy the code. By - java tutorial - team

Output

Math.tan(1.1344640137963142)=2.1445069205095586
Math.tan(1.3962634015954636)=5.671281819617707

Basic values of tangent:

 tan-table

Learn java - java tutorial - tan table - java examples - java programs


Related Searches to Java Math.tan() Method