Commit 36357be7 authored by Justin Dearden's avatar Justin Dearden
Browse files

Version 2.2

Implemented Factorial,Power and Radian functions - portion of test cases passing
parent 76c30bec
package assignment2B;
public class TrigFunctions {
public static double factorial(int i) {
if (i == 1) {
return 1;
}
return i * TrigFunctions.factorial(i - 1);
}
public static double power(double base, double power) {
double results = base;
for (int j = 1; j < power; j++) {
results = results * base;
}
return results;
}
public static double toRadian(double degrees) {
double result = degrees * (3.141592653589793 / 180);
return result;
}
public static double sin(double degrees) {
return 0;
}
public static double cos(double degrees) {
return 0;
}
public static double tan(double degrees) {
return 0;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment