You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
444 B
16 lines
444 B
public class Trigonometric_Functions {
|
|
public Trigonometric_Functions(String chose,double Value) {
|
|
double a = Math.toRadians(Value);
|
|
switch(chose) {
|
|
case "sin":
|
|
System.out.println(String.format("%.2f",Math.sin(a)));
|
|
break;
|
|
case "cos":
|
|
System.out.println(String.format("%.2f",Math.cos(a)));
|
|
break;
|
|
case "tan":
|
|
System.out.println(String.format("%.2f",Math.tan(a)));
|
|
break;
|
|
}
|
|
}
|
|
} |