ScientificOperations.java 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /**
  2. * Write a description of class ScientificOperations here.
  3. *
  4. * @author (your name)
  5. * @version (a version number or a date)
  6. */
  7. public class ScientificOperations
  8. {
  9. // instance variables - replace the example below with your own
  10. private int x;
  11. /**
  12. * Constructor for objects of class ScientificOperations
  13. */
  14. public ScientificOperations()
  15. {
  16. // initialise instance variables
  17. x = 0;
  18. }
  19. public static double product(double a,double b)
  20. { return a*b;
  21. }
  22. public static double Exponent(double a,double b)
  23. {
  24. return Math.pow(a,b);
  25. }
  26. public static double Inverse(int x)
  27. {
  28. double val=(double)x;
  29. return 1/val;
  30. }
  31. public static double ScientificSin(int x)
  32. {
  33. double val=Math.sin((double)x);
  34. return val;
  35. }
  36. public static double ScientificCosin(int x)
  37. {
  38. double val=Math.cos((double)x);
  39. return val;
  40. }
  41. public static double ScientificTan(int x)
  42. {
  43. double val=Math.tan((double)x);
  44. return val;
  45. }
  46. public static double InverseSin(int x)
  47. {
  48. double val=Math.asin((double)x);
  49. return val;
  50. }
  51. public static double InverseCos(int x)
  52. {
  53. double val=Math.acos((double)x);
  54. return val;
  55. }
  56. public static double add(double x,double y)
  57. {
  58. return x+y;
  59. }
  60. public static double sub(double x,double y)
  61. { return x-y;
  62. }
  63. }