plot h*(atan(tan(pi*x/w)s)/pi + floor(x/w + 1/2)), where h=10, w=20, s=.1