function approxSin(pas,p,q)
  t = pas;
  x = [0:t:4*%pi]';
  y = sin(x);
  z = []
  for i=1:length(y) do
    [a,b,c] = dec2bin(y(i),p,q);
    tmp  = bin2dec(a,b,c,p,q);
    z($+1) = tmp(1,1);
  end;
  plot2d2(x,z,2);
  plot(x,y);
  a=gca();
  a.x_location = "origin";
  a.y_location = "origin";
endfunction

