0

I am looking for a function in Python that would tell me if a given vector in 3D is in the convex hull of other vectors, i.e. if the vector can be represented as a convex combination of a set of vectors.

I have only found a function that solves the linear equation for a full rank matrix, using np.linalg.solve() function. In my case the vectors in the convex hull could be linearly dependent, so this approach doesn't work. Here is random data example generated in 3D:

import numpy
mat = np.random.rand(15,3)
vec = np.random.rand(1,3)

I am looking for either a convex solution for the problem:

convex_sol(mat,vec) = [0.2,0.3,0.4]

or a boolean solution that returns True is vec is in the convex hull of mat, and False otherwise.

Sanya Pushkar
  • 180
  • 1
  • 16

0 Answers0