|
@ -42,7 +42,6 @@ double pi(double eps){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
double sinD(double degrees){ |
|
|
double sinD(double degrees){ |
|
|
|
|
|
|
|
|
if (degrees>=360.0){ |
|
|
if (degrees>=360.0){ |
|
|
degrees = squashDegreesTo360(degrees); |
|
|
degrees = squashDegreesTo360(degrees); |
|
|
} |
|
|
} |
|
@ -60,4 +59,24 @@ double sinD(double degrees){ |
|
|
else sum -= currvalue; |
|
|
else sum -= currvalue; |
|
|
} |
|
|
} |
|
|
return sum; |
|
|
return sum; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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; |
|
|
|
|
|
} |
|
|
|
|
|
return sum; |
|
|
} |
|
|
} |