From 6da1a71d3a64eddd9196d594895901e24c73109a Mon Sep 17 00:00:00 2001 From: fangchengyun <1227764354@qq.com> Date: Thu, 6 Aug 2020 21:04:53 +0800 Subject: [PATCH] first commit --- d.java | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 d.java diff --git a/d.java b/d.java new file mode 100644 index 0000000..a6ea180 --- /dev/null +++ b/d.java @@ -0,0 +1,27 @@ +package ¼Ó¼õ³Ë³ý; +import java.util.*; +public class d { + String s; + double x; + public d(String s,double x) + { + this.s=s; + this.x=x; + } + public double sanjiao() + { + if (s.equals("sin")) return sin(x); + else if (s.equals("cos")) return cos(x); + else if (s.equals("tan")) return tan(x); + else if (s.equals("asin")) return asin(x); + else if (s.equals("acos")) return acos(x); + else if (s.equals("atan")) return atan(x); + else return Double.POSITIVE_INFINITY; + } + private double sin(double x) {return Math.sin(x);} + private double cos(double x) {return Math.cos(x);} + private double tan(double x) {return Math.tan(x);} + private double asin(double x) {return Math.asin(x);} + private double acos(double x) {return Math.acos(x);} + private double atan(double x) {return Math.atan(x);} +}