Here are the definitions I am dealing with.
- In all cases the convex hull of a point is the point itself and the convex hull of coincident points are the points themselves.
- In 1-D space, the convex hull of a two points is the line segment joining the two points.
- In 2-D space, the convex hull of (a) two points is the line segment joining them and that of(b) three or more points is (i) the line segment joining the two extremal points if they are collinear or (ii) the usual definition.
- In 3-D space, the convex hull of (a) two points is the line segment joining them in 3-D space, (b) three points is (i) the line segment joining the two extremal points if they are collinear, or (ii) the triangle formed by them in the plane defined by the three points. Similarly the convex hull of (c) four or more points is (i) the line segment joining the two extremal points if they are all collinear, or (ii) the quadrilateral formed by them if they all line in the same plane or (iii) the usual definition of a tetrahedral
- and so on.
My problem is that convexhulln doesn't handle the degenerate cases. It always needs (n+1) non-collinear points in an n-dimensional space to run. Is there a fix for this; or a way out of this? My overall aim is to check if some given test point is in the convex hull of a given set of points (where the degenerate definitions of convex hull hold as defined above).
Example:
p1=[0 0 0]; p2=[0 0 4]; p3=[-5 0 4]; P=[p1;p2;p3];
Then the convex hull of P is triangle in the x-z plane (that is y=0 plane) with vertices at [-5,4], [0,4] and [0,0] and I want to check some point (obviously with y-coordinate 0) belongs to this triangle.
Thank you for your help in advance.
Best Answer