123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- import java.util.*;
- /**
- * Write a description of class Calculator here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class MathMethods
-
- {
-
- public static Double add(double n1, double n2){
- return (n1 + n2);
- }
-
- public static Double subtract(double n1, double n2){
- return (n1 - n2);
- }
-
- public static Double multiply(double n1, double n2){
- return (n1 * n2);
- }
-
- public static Double divide(double n1, double n2){
- return (n1 / n2);
- }
-
- public static Double exponent(double n1, double n2){
- return (Math.pow(n1, n2));
- }
-
- public static Double cosine(double n1){
- return (Math.cos(n1));
- }
-
- public static Double invCosine(double n1){
- return (Math.acos(n1));
- }
-
- public static double squareRoot(double n1) {
- return (Math.sqrt(n1));
-
- }
-
- public static double invert(double n1) {
- return (n1*-1);
-
- }
-
- public static double sin(double n1){
- return (Math.sin(n1));
-
- }
-
- public static double iSin(double n1){
- return (Math.asin(n1));
-
- }
-
- public static double degToRad(double n1) {
- return (Math.toRadians(n1));
-
- }
-
- public static double radToDeg(double n1) {
- return (Math.toDegrees(n1));
-
- }
-
- public static double square(double n1) {
- return Math.pow(n1, 2);
-
- }
-
- public static double inverse(double n1) {
- return n1;
- }
-
- public static double tangent(double n1) {
- return Math.tan(n1);
- }
-
- public static double itan(double n1) {
- return Math.atan(n1);
- }
-
- public static void printAns(String printAnswer){
- System.out.println("ANSWER: " + printAnswer);
- }
-
- }
-
-
-
- // public static double squareRoot(double n1) {
- // double result = Math.sqrt(x);
- // return result;
- // }
-
- // public static double invert(double n1) {
- // double result = x*-1;
- // return result;
- // }
-
- // public static double sin(double n1){
- // double result = Math.sin(x);
- // return result;
- // }
-
- // public static double iSin(double n1){
- // double result = Math.asin(x);
- // return result;
- // }
-
- // public static double degToRad(double n1) {
- // double result = Math.toRadians(x);
- // return result;
- // }
-
- // public static double radToDeg(double n1) {
- // double result = Math.toDegrees(x);
- // return result;
- // }
-
- // public static Double exponent(double n1, double n2){
- // return (Math.pow(n1, n2));
- // }
-
- // public static Double cosine(double n1){
- // return (Math.cos(n1));
- // }
-
- // public static Double invCosine(double n1){
- // return (Math.acos(n1));
- // }
-
|