0
$\begingroup$

Suppose that I want to plot the convex hull of the following set of vectors: namely, \begin{equation} Co(X)=Co\{(1,0,1,1),(0,0,2,1),(0,0,1,2),(0,1,1,1),(1,1,1,0),(1,1,0,1),(1,2,0,0)\} \end{equation} Because the matrix given by the original set of vectors has rank $4$, its convex hull does not lie in a three-dimensional space. However, the matrix given by my original vectors can be translated by subtracting the first vector in such a manner that its convex hull is three-dimensional. In other words, the following convex hull is three-dimensional because the translated matrix has rank $3$ and can therefore be plotted: \begin{equation} Co(X^{\prime})=Co\{(0, 0, 0, 0), (-1, 0, 1, 0), (-1, 0, 0, 1), (-1, 1, 0, 0), (0, 1, 0, -1), (0, 1, -1, 0), (0, 2, -1, -1)\} \end{equation}

Hence, my question is simple: can anybody provide some code that plots the convex hull $Co(X^{\prime})$?

Thank you all very much in advance for your time.

PS: In case somebody wants a little bit of background to see where this question comes from, see this question and this other one.

$\endgroup$

1 Answer 1

2
$\begingroup$

Just project all points into 3D plane.

mat = {{-1, 0, 1, 0}, {-1, 0, 0, 1}, {-1, 1, 0, 0}, {0, 1, 0, -1}, {0,
1, -1, 0}, {0, 2, -1, -1}}
ort = NullSpace[{{-1, 0, 1, 0}, {-1, 0, 0, 1}, {-1, 1, 0, 0}, {0, 1, 
0, -1}, {0, 1, -1, 0}, {0, 2, -1, -1}}]
ns = NullSpace[ort]
data3d = mat.Transpose[ns]


Needs["TetGenLink`"]
{pts, surface} = TetGenConvexHull[data3d];
Graphics3D[GraphicsComplex[pts, Polygon[surface]]]
$\endgroup$
6
  • $\begingroup$ Thank you very much for your answer. Could you please tell me how to get a ball in the corresponding vector $\kappa=(\frac{1}{2},\frac{1}{2},\frac{7}{6},\frac{5}{6})$, please? $\endgroup$
    – EoDmnFOr3q
    Feb 6, 2018 at 18:13
  • 1
    $\begingroup$ @Héctor how to get a what? $\endgroup$ Feb 6, 2018 at 18:35
  • $\begingroup$ A ball (or a circumference, or a dot or a square or some symbol) indicating that where the vector $\kappa=(\frac{1}{2},\frac{1}{2},\frac{7}{6},\frac{5}{6})$ is located in the plot. $\endgroup$
    – EoDmnFOr3q
    Feb 6, 2018 at 18:44
  • 1
    $\begingroup$ @Héctor it's not in that 3D plane. It's projection has coordinates {1/3, 2/3, 0}. $\endgroup$ Feb 6, 2018 at 18:52
  • $\begingroup$ Exactly! And how would you plot that $\kappa^{\prime}=(\frac{1}{3},\frac{2}{3},0)$ in the figure? $\endgroup$
    – EoDmnFOr3q
    Feb 6, 2018 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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