Guest User

Untitled

a guest
Apr 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. double cos(double c){
  2. double x=c;
  3. if(x>PI*2)x-=PI*2;
  4. int N = 2*20;
  5. double mx2 = -x*x;
  6.  
  7.     int i;
  8.     double part = 1, sum = 1;
  9.     for (i = 2; i < N; i+=2) {
  10.         part *= mx2/((i-1)*i);
  11.         sum += part;
  12.     }
  13.   return sum;
  14. }
  15. //синус,из косинуса
  16. double sin(double x){return cos(((PI/2.0)-x));}
Add Comment
Please, Sign In to add comment