Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

N-D Voronoi diagram

`[V,C] = voronoin(X)`

[V,C] = voronoin(X,options)

`[V,C] = voronoin(X)`

returns
Voronoi vertices `V`

and the Voronoi cells `C`

of
the Voronoi diagram of `X`

. `V`

is
a `numv`

-by-`n`

array of the `numv`

Voronoi
vertices in n-dimensional space, each row corresponds to a Voronoi
vertex. `C`

is a vector cell array where each element
contains the indices into `V`

of the vertices of
the corresponding Voronoi cell. `X`

is an `m`

-by-`n`

array,
representing `m`

n-dimensional points, where ```
n
> 1
```

and `m >= n+1`

.

The first row of `V`

is a point at infinity.
If any index in a cell of the cell array is `1`

,
then the corresponding Voronoi cell contains the first point in `V`

,
a point at infinity. This means the Voronoi cell is unbounded.

`voronoin`

uses Qhull.

`[V,C] = voronoin(X,options)`

specifies a
cell array of Qhull options. The default options are:

`{'Qbb'}`

for 2- and 3-dimensional input`{'Qbb','Qx'}`

for 4 and higher-dimensional input

If `options`

is `[]`

, the
default options are used. If `code`

is `{''}`

,
no options are used, not even the default. For more information on
Qhull and its options, see `http://www.qhull.org`

.

You can plot individual bounded cells of an n-dimensional Voronoi
diagram. To do this, use `convhulln`

to
compute the vertices of the facets that make up the Voronoi cell.
Then use `patch`

and other plot
functions to generate the figure.

`voronoin`

is based on Qhull [1].
For information about Qhull, see `http://www.qhull.org/`

.

[1] Barber, C. B., D.P. Dobkin, and H.T. Huhdanpaa, “The Quickhull Algorithm for Convex Hulls,” ACM Transactions on Mathematical Software, Vol. 22, No. 4, Dec. 1996, p. 469-483.

Was this topic helpful?