1
$\begingroup$

Consider the $10 \times 3$ matrix ${\bf A}$ and the inequalities ${\bf A}{\bf x} \leq {\bf b}$:

$$ \begin{bmatrix} 0 & 1 & 1 \\ 1 & 0 &1 \\ 1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & -1 \\ 0 & 0& 1\\ 0 & -1& 0\\ 0 & -1& 1\\ -1 & 0& 0\\ -1 & 0& 1 \end{bmatrix} \begin{bmatrix} x_1\\ x_2\\ x_3 \end{bmatrix} = \begin{bmatrix} 4\\ 4\\ 3\\ 3\\ 0\\ 2\\ 0\\ 1\\ 0\\ 1 \end{bmatrix} $$

How can I show its shape from Mathematica?

enter image description here

$\endgroup$
  • 3
    $\begingroup$ Maybe ImplicitRegion? $\endgroup$ – halmir Dec 1 '17 at 15:57
3
$\begingroup$
myA = {{0, 1, 1}, {1, 0, 1}, {1, 0, 0}, {0, 1, 0}, {0, 0, -1}, 
      {0, 0, 1}, {0, -1, 0}, {0, -1, 1}, {-1, 0, 0}, {-1, 0, 1}};

b = {4, 4, 3, 3, 0, 2, 0, 1, 0, 1};

myregion = ImplicitRegion[
 And @@ Table[myA[[j]].{x, y, z} <= b[[j]], {j, Length[myA]}],
{x,y,z}]

RegionPlot3D[myregion, 
   PlotPoints -> 50, 
   Axes->True, 
   Mesh -> 5,
   MeshStyle -> Red,
   PlotStyle->Opacity[0.5]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.