Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double cos(double c){
- double x=c;
- if(x>PI*2)x-=PI*2;
- int N = 2*20;
- double mx2 = -x*x;
- int i;
- double part = 1, sum = 1;
- for (i = 2; i < N; i+=2) {
- part *= mx2/((i-1)*i);
- sum += part;
- }
- return sum;
- }
- //синус,из косинуса
- double sin(double x){return cos(((PI/2.0)-x));}
Add Comment
Please, Sign In to add comment