Advertisement
STANAANDREY

cos1

Mar 13th, 2023
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. function y=cos1(x)
  2. b=pi*(0:3)/6;
  3. yb=cos(b);
  4. c=newtondd(b,yb,4);
  5. s=1;
  6. x1=mod(x,2*pi);
  7. if x1>pi
  8. x1 = 2*pi-x1;
  9. s = -1;
  10. end
  11. if x1 > pi/2
  12. x1 = pi-x1;
  13. end
  14. y = s*nested(3,c,x1,b);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement