scienticFunctions.java 955B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /**
  2. * Write a description of class scienticFunctions here.
  3. *
  4. * @author (Roy Mpanju)
  5. * @version (a version number or a date)
  6. */
  7. import java.lang.*;
  8. public class scienticFunctions
  9. {
  10. /**
  11. * A method - find solve for the trignometry functions of a given number by converting it to radians
  12. *
  13. * @param y a sample parameter for a method
  14. * @return the sine of y
  15. */
  16. public static double sine(double y){
  17. return Math.sin(Math.toRadians(y));
  18. }
  19. public static double cosine(double y){
  20. return Math.cos(Math.toRadians(y));
  21. }
  22. public double tangent(double y){
  23. return Math.tan(Math.toRadians(y));
  24. }
  25. public double inverseCosine(double y){
  26. return Math.acos(y) * 180/Math.PI;
  27. }
  28. public double inverseSine(double y){
  29. return (Math.asin(y))* 180/Math.PI;
  30. }
  31. public double inverseTangent(double y){
  32. return (Math.atan(y))*180/Math.PI;
  33. }
  34. }