|
|
@ -45,19 +45,14 @@ double sinD(double degrees){ |
|
|
|
if (degrees>=360.0){ |
|
|
|
degrees = squashDegreesTo360(degrees); |
|
|
|
} |
|
|
|
|
|
|
|
double sum = 0.0; |
|
|
|
double currvalue; |
|
|
|
double radian = radians(degrees); |
|
|
|
double power; |
|
|
|
unsigned long long faculty; |
|
|
|
for (int i = 0; i <= 9; i++) |
|
|
|
{ |
|
|
|
currvalue = 1.0; |
|
|
|
currvalue *= powerD(2*i+1, radian); |
|
|
|
currvalue /= (double) fac(2*i+1); |
|
|
|
if(i%2==0) sum += currvalue; |
|
|
|
else sum -= currvalue; |
|
|
|
|
|
|
|
for (int i = 0; i <= 9; i++){ |
|
|
|
sum += powerD((double) i, -1.0) * (powerD(2.0*i+1, radian) / fac(2.0*i+1)); |
|
|
|
} |
|
|
|
|
|
|
|
return sum; |
|
|
|
} |
|
|
|
|
|
|
@ -65,19 +60,14 @@ double cosD(double degrees){ |
|
|
|
if (degrees>=360.0){ |
|
|
|
degrees = squashDegreesTo360(degrees); |
|
|
|
} |
|
|
|
|
|
|
|
double sum = 0.0; |
|
|
|
double currvalue; |
|
|
|
double radian = radians(degrees); |
|
|
|
double power; |
|
|
|
unsigned long long faculty; |
|
|
|
for (int i = 0; i <= 9; i++) |
|
|
|
{ |
|
|
|
currvalue = 1.0; |
|
|
|
currvalue *= powerD(2*i, radian); |
|
|
|
currvalue /= fac(2*i); |
|
|
|
if(i%2==0) sum += currvalue; |
|
|
|
else sum -= currvalue; |
|
|
|
|
|
|
|
for (int i = 0; i <= 9; i++){ |
|
|
|
sum += powerD((double) i, -1.0) * (powerD(2*i, radian) / fac(2*i)); |
|
|
|
} |
|
|
|
|
|
|
|
return sum; |
|
|
|
} |
|
|
|
|
|
|
|