cvt_4_movie, a MATLAB code which creates a Centroidal Voronoi Tessellation (CVT) movie in the unit square, with a density function that drives points to the corners;

The action takes place in a square; however, a nonuniform density function is applied, which effectively increases the "weight" of regions in the corners; for this iterative algorithm, the effect of the density function is that many more sample points will come from the corners than from the center. The CVT cells will correspondingly tend to migrate away from the center.

The data that the user may set includes:


The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.


cvt_4_movie is available in a MATLAB version.

Related Data and Programs:

cavity_flow_movie, a MATLAB code which animates the velocity solutions for the driven cavity;

cvt_1_movie, a MATLAB code which creates an animation of the evolution of a Centroidal Voronoi Tessellation (CVT) in the unit square.

cvt_2_movie, a MATLAB code which animates the generation of a Centroidal Voronoi Tessellation (CVT) in the unit square, which includes a random "rebirth" at every iteration.

cvt_3_movie, a MATLAB code which animates the generation of a Centroidal Voronoi Tessellation (CVT) for the "holey pie" region.


cvt_corn_movie, a MATLAB code which makes a movie in which the growth of a corn kernel is simulated using a Centroidal Voronoi Tessellation (CVT).

peak_movie, a MATLAB code which creates a sequence of frames, and then an animation or movie from the data displayed by the peaks() function.

pendulum_double_ode_movie, a MATLAB code which solves the double pendulum ordinary differential equation (ODE) for a given set of initial conditions and parameters, and makes a movie of the results.

shallow_water_1d_movie, a MATLAB code which solves the partial differential equation (PDE) known as the shallow water equations (SWE), converting the solutions to a sequence of graphics frames, which are then assembled into a movie.

spiral_pde_movie, a MATLAB code which solves a pair of reaction-diffusion partial differential equations (PDE) over a rectangular domain with periodic boundary condition, whose solution is known to evolve into a pair of spirals. The sequence of solutions is bundled into a movie.

tetrahedron_slice_movie, a MATLAB code which is given a tetrahedron and a vector, displays an evenly spaced sequence of planes that intersect the tetrahedron and are normal to the vector, and creates a movie of the process.


  1. Franz Aurenhammer,
    Voronoi diagrams - a study of a fundamental geometric data structure,
    ACM Computing Surveys,
    Volume 23, Number 3, pages 345-405, September 1991.
  2. Qiang Du, Vance Faber and Max Gunzburger,
    Centroidal Voronoi Tessellations: Applications and Algorithms,
    SIAM Review, Volume 41, 1999, pages 637-676.

Source Code:

Last revised on 13 December 2020.