# boundingbox

Tags:

Updated:

boundingbox computes the smallest possible bounding box of a set.

### Syntax

[B,L,U] = boundingbox(Constraint,options,x)


### Example

The typical use is as follows

sdpvar x y
Ball = x^2+y^2 <= 1
Box = boundingbox(Ball);
plot(Box,[x y]);
hold on
plot(Ball,[x y],'y')


By using more outputs, we can extract the numerical bounds also

[Bound,L,U] = boundingbox(Ball);


One can also compute the bounding box w.r.t a subset of the variables, i.e., the bounding box of a projection (this is the recommended way to use the command, since you will have no knowledge about the relation between your variables of interest and the ordering in L and U otherwise)

sdpvar x y z
Ball = x^2+y^2 +z^2 <= 1
Box = boundingbox(Ball,[],[x y]);
plot(Box,[x y]);
hold on
plot(Ball,[x y z],'y')