 function [result] = Intervall_hull(s,d)
% % Input:
% % s: function handle (support function of the conves set S)
% % d: integer (number of dimensions)
%
% 
% % Output:
% % result: function handle (support function of non symmetric box)
% 
% 
% % Description:
% % Generates the intervall hull BoxS=[a_1;b_1]...[a_d;b_d] of the convex set S
% % where a vector the lower bounds of of BoxS a=(a_1;...;a_d)'
% %       b vector the upper bounds of of BoxS b=(b_1;...;b_d)'


L = vectorgenerator(d);
a = zeros(d,1);
b = zeros(d,1);
for i=1:2:2*d
        b((i+1)/2) = (s(L(i,:)'));
        a((i+1)/2) =-(s(L(i+1,:)'));
end
result = @(l) (abs(a-b)/2)'*abs(l)+((a+b)/2)'*l;
end
