TrigFunctions.java 857B

123456789101112131415161718192021222324252627282930
  1. import java.util.*;
  2. public class TrigFunctions
  3. {
  4. public static double sin(double curNum){
  5. double degrees= curNum;
  6. double radians= Math.toRadians(degrees);
  7. double sinValue= Math.sin(radians);
  8. System.out.println("sin("+degrees+") = " + sinValue);
  9. return sinValue;
  10. }
  11. public static double cosine(double curNum){
  12. double degrees= curNum;
  13. double radians= Math.toRadians(degrees);
  14. double cosValue= Math.cos(radians);
  15. System.out.println("cos("+degrees+") = " + cosValue);
  16. return cosValue;
  17. }
  18. public static double tangent(double curNum){
  19. double degrees= curNum;
  20. double radians= Math.toRadians(degrees);
  21. double tanValue= Math.tan(radians);
  22. System.out.println("tam("+degrees+") = " + tanValue);
  23. return tanValue;
  24. }
  25. }