123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
-
- public class ScientificFunctions
- {
-
- public static double display = 0;
- public static double memory = 0;
- public static boolean degMode = true;
- public static boolean radMode = false;
- public static boolean decMode = true;
- public static boolean hexMode = false;
- public static boolean binMode = false;
- public static boolean octMode = false;
- public static boolean celsius;
- public static boolean fahrenheit;
- public static String hexOut;
- public static String binOut;
- public static String octOut;
-
-
- public static double sqr(double display) {
- System.out.println( display * display);
- return display = display * display;
- }
-
- public static double sqRoot(double display) {
- System.out.println(Math.sqrt(display));
- return display = Math.sqrt(display);
- }
-
- public static double invFraction(double display) {
- System.out.println( 1 / display);
- return display = 1 / display;
- }
-
- public static double invSign(double display) {
- System.out.println( -1*display);
- return display = -1*display;
- }
-
- public static double setMem(double display) {
- System.out.println("Set to memory!");
-
- return memory = display;
-
- }
- public static double resetMem() {
- System.out.println("Memory Reset!");
- return memory = 0;
-
- }
-
- public static double recallMem() {
- System.out.println("Memory Recalled!");
- return display = memory;
-
- }
-
- public static double cosine(double display) {
- if (degMode == true){
- System.out.println(Math.cos(Math.toRadians(display)));
- return Math.cos(Math.toRadians(display));
- } else {
- System.out.println(Math.cos(display));
- return Math.cos(display);
- }
-
-
- }
-
- public static double sin(double display) {
- if (degMode == true){
- System.out.println(Math.sin(Math.toRadians(display)));
- return Math.sin(Math.toRadians(display));
- } else {
- System.out.println(Math.sin(display));
- return Math.sin(display);
- }
- }
-
- public static double tan(double display) {
- if (degMode == true){
- System.out.println(Math.tan(Math.toRadians(display)));
- return Math.tan(Math.toRadians(display));
- } else {
- System.out.println(Math.tan(display));
- return Math.tan(display);
- }
- }
-
- public static double acosin(double display) {
- if (degMode == true){
- System.out.println(Math.acos(Math.toRadians(display)));
- return Math.acos(Math.toRadians(display));
- } else {
- System.out.println(Math.acos(display));
- return Math.acos(display);
- }
- }
-
- public static double asin(double display) {
- if (degMode == true){
- System.out.println(Math.asin(Math.toRadians(display)));
- return Math.asin(Math.toRadians(display));
- } else {
- System.out.println(Math.asin(display));
- return Math.asin(display);
- }
- }
-
- public static double atan(double display) {
- if (degMode == true){
- System.out.println(Math.atan(Math.toRadians(display)));
- return Math.atan(Math.toRadians(display));
- } else {
- System.out.println(Math.atan(display));
- return Math.atan(display);
- }
- }
-
- public static double cToF(double display){
- System.out.println((5 * (display - 32 ) / 9));
- return (5*(display-32)/9);
-
- }
-
- public static double fToC(double display){
- System.out.println(9*(display/5)+32);
- return (9*(display/5)+32);
- }
-
- }
|