15.11.2014 Views

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2 Polynomials and Interpolation<br />

Because a Voronoi cell can be unbounded, the first row <strong>of</strong> V is a point at infinity.<br />

Then any unbounded Voronoi cell in C includes the point at infinity, i.e., the<br />

first point in V.<br />

This example uses the same X as in the Delaunay example, i.e., the 8 corner<br />

points <strong>of</strong> a cube and its center. Random noise is added to make the cube less<br />

regular. The resulting Voronoi diagram has 9 Voronoi cells:<br />

d = [-1 1];<br />

[x,y,z] = meshgrid(d,d,d);<br />

X = [x(:),y(:),z(:)]; % 8 corner points <strong>of</strong> a cube<br />

X(9,:) = [0 0 0];<br />

% Add center to the vertex list.<br />

X = X+0.01*rand(size(X)); % Make the cube less regular.<br />

[V,C] = voronoin(X);<br />

V =<br />

Inf Inf Inf<br />

0.0055 1.5054 0.0004<br />

0.0037 0.0101 -1.4990<br />

0.0052 0.0087 -1.4990<br />

0.0030 1.5054 0.0030<br />

0.0072 0.0072 1.4971<br />

-1.7912 0.0000 0.0044<br />

-1.4886 0.0011 0.0036<br />

-1.4886 0.0002 0.0045<br />

0.0101 0.0044 1.4971<br />

1.5115 0.0074 0.0033<br />

1.5115 0.0081 0.0040<br />

0.0104 -1.4846 -0.0007<br />

0.0026 -1.4846 0.0071<br />

C =<br />

[1x8 double]<br />

[1x6 double]<br />

[1x4 double]<br />

[1x6 double]<br />

[1x6 double]<br />

[1x6 double]<br />

[1x6 double]<br />

[1x6 double]<br />

[1x12 double]<br />

2-32

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!