% 'delaunay_01.m'
% This script generates the Delaunay trnagulation 
% along with the associated Voronoi diagrams for
% a set of ten randomly generated points

echo off, clc
clear all

%rand('state',0);
x = rand(1,10);
y = rand(1,10);
TRI = delaunay(x,y);
subplot(1,2,1),...
triplot(TRI,x,y)
axis([0 1 0 1]);
hold on;
plot(x,y,'or');
hold off


[vx, vy] = voronoi(x,y,TRI);
subplot(1,2,2),...
plot(x,y,'r+',vx,vy,'b-'),...
axis([0 1 0 1])
    
