# Point inside convex polyhedron defined by planes

This topic is 2122 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Given a set of planes that define a convex polyhedron. I would need to quickly find an arbitrary point inside the polyhedron. Not necessarily, but ideally the centroid. I want to do this without any plane intersections if possible.

##### Share on other sites

You need to prove that your planes halfspaces define a non-empty convex polyhedron first; I don't think there are practical ways which don't involve intersecting planes and convex polyhedra and building explicit faces, edges and vertices (from which computing the centroid is easy).

##### Share on other sites
I haven't tested it, but maybe you can do this:

Your plane equations are: Ni*x-Di, with Ni normalized row vectors, Di are scalars, and x is a column vector.
Now minimize the sum of squared distances with respect to x: S=sum[(Ni*x-Di)^2]
Obtain: x=((sum[Ni^T*Ni])^+) * sum[Di*Ni^T]
I'm almost sure that the pseudo-inverse is not required (and you can take the regular inverse), because this reminds me a lot of SVD. However, this is just a hunch.

EDIT: Yup, the matrix should be invertible for any closed polyhedrons. No need for pseudo-inverse. Edited by max343

##### Share on other sites

You just need to check if the point is behind (ie half-spaces) every plane defining your volume. If so, the point is inside your volume

EDIT Sorry if it's not the point of your question

Edited by Tournicoti

##### Share on other sites

You just need to check if the point is behind (ie half-spaces) every plane defining your volume. If so, the point is inside your volume

Sure, but the question was how to find such a point that satisfies this criteria.

Thanks max343. I was thinking that this is a minimization problem, but I am bit rusty here.  I will look into this!

##### Share on other sites
BTW, sometimes it makes more sense to find the center of the circumscribed sphere rather than the centroid (which gives bias to clustered vertices). In this case you can do this:
1. Find x0 as I previously described.
2. Solve the weighted minimization problem with the weights: Wi = |Ni*x0-Di|

##### Share on other sites
This sounds similar to finding a feasible solution to a linear-programming problem, so I am sure there is literature about it. This seems to be called "Phase I" in the simplex algorithm. I read the description in Wikipedia, but I am not sure I understand it.

##### Share on other sites

I wonder if there's some sort of "generalized barycentric coordinate" formulation to handle this scenario...

##### Share on other sites

This sounds similar to finding a feasible solution to a linear-programming problem, so I am sure there is literature about it. This seems to be called "Phase I" in the simplex algorithm. I read the description in Wikipedia, but I am not sure I understand it.

I don't think that Simplex algorithm is the best choice here, since it searches for maximum on the boundary, while OP wanted some interior point.

##### Share on other sites

This sounds similar to finding a feasible solution to a linear-programming problem, so I am sure there is literature about it. This seems to be called "Phase I" in the simplex algorithm. I read the description in Wikipedia, but I am not sure I understand it.

I don't think that Simplex algorithm is the best choice here, since it searches for maximum on the boundary, while OP wanted some interior point.

Please, read my post carefully. The simplex algorithm has two phases: Phase I finds a feasible configuration, and phase II improves the configuration to find the optimum value of the objective function. Phase I of the simplex algorithm is exactly the same problem the OP has.

1. 1
2. 2
3. 3
4. 4
Rutin
15
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633724
• Total Posts
3013556
×