Getting the cos, sin or tan or a number

The hypotenuse is the longest side across from the right angle.
 
               b
              /|
             / |
 hypotenuse /  | opposite
           /   |
          /    |
       a ------- c
         adjacent
 
   sin of a = bc / ab = opposite / hypotenuse
   cos of a = ac / ab = adjacent / hypotenuse
   tan of a = bc / ac = opposite / adjacent

In Java, you can use the static methos in the Math class to determine the sin, cos and tan of an angle.
Here’s an example:

import java.math.*;
                           
public class Main
{  
   public static void main(String args[]) throws Exception {
      double angle = 0.23456;
 
      double sinAngle = Math.sin(angle);
      double cosAngle = Math.cos(angle);
      double tanAngle = Math.tan(angle);
 
      System.out.println("sin of " + angle + ": " + sinAngle);
      System.out.println("cos of " + angle + ": " + cosAngle);
      System.out.println("tan of " + angle + ": " + tanAngle);
   }
}

outputs:

sin of 0.68: 0.6287930240184686
cos of 0.68: 0.7775727187509279
tan of 0.68: 0.8086613751425653

Note: angles to the trigonometric math methods should be given in radians.
If you want to use degrees, you have to convert the radians first:

     360 degrees = 2 pi radians
 
     So, to convert radians into degrees, multiply by 180 / Math.PI
         to convert degrees into radians, multiply by Math.PI / 180