function wint = dataint(w)
% assumes domain w(1,:) range w(2,:)
x = w(1,:); y = w(2,:); n = size(x,2);
newx = zeros(1,n+1); newy = zeros(1,n+1);
dx = x(2:end) - x(1:end-1);
mx = (x(2:end) + x(1:end-1))/2;
newx = [x(1)-dx(1)/2, mx, x(end)+dx(end)/2];
%newx(1) = newx(2)-dx(1);
%newx(n+1) = newx(n)+dx(n-1);
newy(1) = 0;
%newx(1) = x(1)-dx(1)/2;
for i = 1:n,
	%newx(i+1) = newx(i)+dx(i);
    newy(i+1) = newy(i)+y(i)*dx(i);
end;
wint = [newx; newy];
