No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
VERT2CON - vertices to constraints

5.0 | 5 ratings Rate this file 17 Downloads (last 30 days) File Size: 1.92 KB File ID: #7895 Version: 1.0
image thumbnail

VERT2CON - vertices to constraints


Michael Kleder (view profile)


22 Jun 2005 (Updated )

Create inequality constraints to bound the convex hull of the given points.

| Watch this File

File Information

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


This file inspired Analyze N Dimensional Polyhedra In Terms Of Vertices Or (In)Equalities.

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
06 Apr 2016 Ali Baradaran

Made my life a lot easier. Thank you guys.

17 Apr 2011 Jay Berger

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

Comment only
11 Feb 2011 Chris Z.

04 Feb 2011 Sean de

Sean de (view profile)

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);

10 Jul 2008 Vishal Narula

nice work..keep it up!

20 Jun 2008 GagoX GagoX

Thanx Michael,

great program! and very elegantly coded as well.

Contact us