I want to find the Centroidal Voronoi but I have been confused . For instance lets say that I have two vectors
X=[1 2 1.1 1.3 1.4 1.5 1.3 1.2 1.8 2.1 2.2]; and
Y=[1.5 1.3 1.5 1.8 1.4 1.6 2.5 2.3 2.4 1.1 1.8];
I use the command voronoi(X,Y) in order to have the diagram (see the attachment) . How can I have the Centroidal Voronoi tessellation according to Lloyd's algorithm ? I have found the Lloyd's algorithm in the internet :
while generating points xi not converged to centroids do
Compute the Voronoi diagram of xi
Compute the centroids Ci using equation (1)
Move each generating point xi to its centroid Ci
end while
but I can't understand what I have to do in order to write the code and take the Centroidal Voronoi in matlab. Any ideas or alternatives please ?
Why not give it a try to CVT Centroidal Voronoi Tessellations
You can find source code and several examples, it has matlab, fortran and c++ source codes
This is from original source