function f = fun_sin(x,k)
%FUN_SIN

if nargin < 2 | k == 0
   f = sin(x);
else
   k = k - 1;
   g = mod(ceil(k/2),2);
   h = mod(k,2);
   if h == 1
      f = sin(x)*(-1)^g; 
   else
      f = cos(x)*(-1)^g; 
   end
end
