thein lwin
0
Q:

how to use math.tan in java

// Java program to demonstrate working 
// of java.lang.Math.tan() method 
import java.lang.Math; 
  
class Gfg { 
  
    // driver code 
    public static void main(String args[]) 
    { 
        double a = 30; 
          
        // converting values to radians 
        double b = Math.toRadians(a); 
  
        System.out.println(Math.tan(b)); 
  
        a = 45; 
          
        // converting values to radians 
        b = Math.toRadians(a); 
  
        System.out.println(Math.tan(b)); 
  
        a = 60; 
          
        // converting values to radians 
        b = Math.toRadians(a); 
  
        System.out.println(Math.tan(b)); 
  
        a = 0; 
          
        // converting values to radians 
        b = Math.toRadians(a); 
  
        System.out.println(Math.tan(b)); 
    } 
} 
1

New to Communities?

Join the community