123456789101112131415161718192021222324252627282930 |
-
- import java.util.*;
- public class TrigFunctions
- {
- public static double sin(double curNum){
- double degrees= curNum;
- double radians= Math.toRadians(degrees);
- double sinValue= Math.sin(radians);
- System.out.println("sin("+degrees+") = " + sinValue);
- return sinValue;
- }
-
- public static double cosine(double curNum){
- double degrees= curNum;
- double radians= Math.toRadians(degrees);
- double cosValue= Math.cos(radians);
- System.out.println("cos("+degrees+") = " + cosValue);
- return cosValue;
- }
-
- public static double tangent(double curNum){
- double degrees= curNum;
- double radians= Math.toRadians(degrees);
- double tanValue= Math.tan(radians);
- System.out.println("tam("+degrees+") = " + tanValue);
- return tanValue;
- }
-
- }
-
|