CVT_METRIC is a collection of MATLAB routines which carry out the computation of a CVT (Centroidal Voronoi Tessellation) calculation under a spatially varying metric.
What we are saying is that the distance between two vectors a and b is no longer simply the Euclidean distance, but rather a quadratic form involving a spatially varying, positive definite symmetric matrix that represents the metric:
d(a,b) = ( a - b )' * A * ( a - b )
We assume that A varies spatially, but we would prefer
to simplify this variation in a manner that saves us computational
effort, while allowing us to recover the variational behavior
if we are willing to use a finer spatial sampling.
The metric function is distinct from the density function, which can also be used in these kinds of problems. The density function is weaker, and corresponds to a metric whose matrix at any point is a multiple of the identity matrix. A density function approach cannot result in the more interesting anisotropic effects that an arbitrary metric produces.
CVT_1D_NONUNIFORM is a MATLAB library of routines which allows the user to watch the evolution of a CVT computed over a 1D interval with a nonuniform density.
CVT_DEMO is a MATLAB library of routines which allows the user to generate a CVT over several geometric regions using uniform or nonuniform density.
LCVT is a MATLAB library of routines which compute a "Latinized" Centroidal Voronoi Tessellation.
TEST_TRIANGULATION is a MATLAB library of routines which define the geometry of a number of sample regions.
The following files contain functions to evaluate various simple metrics:
Here are images of CVT point sets. These are crude calculations, with a relatively low number of sample points and iterations. This is partly because I haven't figured out how to optimize these calculations in MATLAB.
You can go up one level to the MATLAB source codes.