File Exchange

image thumbnail

VERT2CON - vertices to constraints

version (1.06 KB) by Michael Kleder
Create inequality constraints to bound the convex hull of the given points.


Updated 11 Jul 2005

No License

VERT2CON - convert a set of points to the set of inequality constraints which most tightly contain the points; i.e., create constraints to bound the convex hull of the given points

[A,b] = vert2con(V)

V = a set of points, each ROW of which is one point
A,b = a set of constraints such that A*x <= b defines the region of space enclosing the convex hull of the given points

For n dimensions:
V = p x n matrix (p vertices, n dimensions)
A = m x n matrix (m constraints, n dimensions)
b = m x 1 vector (m constraints)

(1) In higher dimensions, redundant constraints can appear. This program detects redundancy at 6 digits of precision (per dimension), then returns the unique constraints.
(2) See companion function CON2VERT.
(3) ver 1.0: initial version, June 2005.
(4) ver 1.1: enhanced redundancy checks, July 2005
(5) Written by Michael Kleder

Cite As

Michael Kleder (2020). VERT2CON - vertices to constraints (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (12)


Hello everyone,
Suppose I have V= 30x14 matrix. Can I visualize what are the points lie on the boundary of the convex region? Actually, I want a similar figure as given on the top left of this page "VERT2CON - vertices to constraints". Is it possible?
Thanks in Advance.

Paul Kane

Made my life a lot easier. Thank you guys.

Jay Berger

Nice program. How do I enforce constraints for points to lie only on the boundary of the convex hull?

Chris Z.

Sean de

Excellent program!
Very useful for calculating 3-dimensional convex masks.

A few speedups for newer versions replacing REPMAT with BSXFUN:
V = bsxfun(@minus,V,c);

and in the example:
p = bsxfun(@le,A*p,b);

Vishal Narula

nice work..keep it up!

GagoX GagoX

Thanx Michael,

great program! and very elegantly coded as well.


Enhanced redundancy checks.

MATLAB Release Compatibility
Created with R14SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux