sphere_cvt
    
    
    
      sphere_cvt,
      an Octave code which
      iteratively approximates a centroidal Voronoi tessellation (CVT) 
      on the unit sphere.
    
    
      The CVT approximation algorithm used here is quite simple.  We start with XYZ, an
      arbitrary set of points on the unit sphere.  We compute the convex hull,
      from that the Delaunay triangulation, and from that the Voronoi diagram.
      Finally, we compute the centroids of the Voronoi polygons, and overwrite XYZ
      with this data.  This iteration may be carried out repeatedly.  While in the
      plane, the Voronoi cells all tend to the same shape and area, on a sphere there
      are certain constraints.  A typical CVT, if it has properly converged, will 
      generally have 12 pentagons, with the other polygons being hexagons.  Cases in
      which polygons of degree 4 or 7 occur indicate that the iteration is not
      near enough to completion.  Because of the occurrence of two polygonal shapes,
      the areas of the cells will tend to two separate values.
    
    
      The code, as presented here, is quite preliminary.  In particular, the process
      of converting the Delaunay information into information about the Voronoi polygons
      is inefficient.  I suspect, though, that I can compute the centroids almost
      immediately, without having to go through the tedious process of determining
      the ordering of the Voronoi vertices that constitute each Voronoi polygon.
      If I can clear that up, then it should be possible to apply this simple algorithm
      to systems with hundreds of points.
    
    
      Licensing:
    
    
      The information on this web page is distributed under the MIT license.
    
    
      Languages:
    
    
      sphere_cvt is available in
      a Fortran90 version and
      a MATLAB version and
      an Octave version.
    
    
      Related Data and Programs:
    
    
      
      sphere_cvt_test
    
    
      
      florida_cvt_geo,
      an Octave code which
      explores the creation of a centroidal voronoi tessellation (cvt) of
      the state of florida, based solely on geometric considerations.
    
    
      
      geometry,
      an Octave code which 
      computes various geometric quantities, including grids on spheres.
    
    
      
      sphere_delaunay, 
      an Octave code which
      computes the delaunay triangulation of points on a sphere.
    
    
      
      sphere_design_rule,
      a fortran90 library which 
      returns point sets on the surface of the unit sphere, known as "designs",
      which can be useful for estimating integrals on the surface, among other uses.
    
    
      
      sphere_grid, 
      an Octave code which 
      provides a number of ways of generating grids of points, or of
      points and lines, or of points and lines and faces, over the unit sphere.
    
    
      
      sphere_lebedev_rule, 
      a dataset directory which 
      contains sets of points on a sphere which can be used for
      quadrature rules of a known precision;
    
    
      
      sphere_quad,
      an Octave code which
      approximates an integral over the surface of the unit sphere
      by applying a triangulation to the surface;
    
    
      
      sphere_voronoi, 
      an Octave code which
      computes the voronoi diagram of points on a sphere.
    
    
      Reference:
    
    
      
        - 
          Qiang Du, Vance Faber, Max Gunzburger,
          Centroidal Voronoi Tessellations: Applications and Algorithms,
          SIAM Review,
          Volume 41, Number 4, December 1999, pages 637-676.
         
        - 
          Jacob Goodman, Joseph ORourke, editors,
          Handbook of Discrete and Computational Geometry,
          Second Edition,
          CRC/Chapman and Hall, 2004,
          ISBN: 1-58488-301-4,
          LC: QA167.H36.
         
        - 
          Lili Ju, Qiang Du, Max Gunzburger,
          Probabilistic methods for centroidal Voronoi tessellations
          and their parallel implementations,
          Parallel Computing,
          Volume 28, 2002, pages 1477-1500.
         
        - 
          Robert Renka,
          Algorithm 772: 
          STRIPACK:
          Delaunay Triangulation and Voronoi Diagram on the Surface 
          of a Sphere,
          ACM Transactions on Mathematical Software,
          Volume 23, Number 3, September 1997, pages 416-434.
         
      
    
    
      Source Code:
    
    
      
        - 
          i4col_compare.m, 
          compares two columns of an I4COL;
        
 
        - 
          i4col_sort_a.m, 
          ascending sorts the columns of an I4COL;
        
 
        - 
          
          i4col_swap.m, 
          swaps two columns of an I4COL;
        
 
        - 
          i4list_print.m, 
          prints an I4LIST;
        
 
        - 
          i4mat_transpose_print.m, 
          prints an I4MAT, transposed;
        
 
        - 
          
          i4mat_transpose_print_some.m, 
          prints some of an I4MAT, transposed;
        
 
        - 
          i4vec_print.m, 
          prints an I4VEC.
        
 
        - 
          r8mat_transpose_print.m, 
          prints the transpose of an R8MAT;
        
 
        - 
          
          r8mat_transpose_print_some.m, 
          prints some of the transpose of an R8MAT;
        
 
        - 
          r8vec_normal_01.m, 
          returns unit pseudonormal R8VEC.
        
 
        - 
          r8vec_print.m, 
          prints an R8VEC.
        
 
        - 
          r8vec_uniform_01.m, 
          returns a unit pseudorandom R8VEC.
        
 
        - 
          sort_heap_external.m, 
          external sorts a list of values into ascending order;
        
 
        - 
          
          sphere_cvt_step.m, 
          carries out one CVT step on the unit sphere; actually it simply
          returns the centroids of the Voronoi polygons associated with a given
          set of points.
        
 
        - 
          
          sphere_delaunay.m, 
          returns the Delaunay triangulation of points on the unit sphere.
        
 
        - 
          
          sphere_voronoi_plot.m, 
          plots the Voronoi diagram of points on the unit sphere.
        
 
        - 
          
          stri_angles_to_area.m, 
          computes the area of a spherical triangle;
        
 
        - 
          
          stri_sides_to_angles.m, 
          computes the angles of a spherical triangle from its sides;
        
 
        - 
          
          stri_vertices_to_area.m, 
          computes the area of a spherical triangle from its vertices;
        
 
        - 
          
          stri_vertices_to_centroid.m, 
          computes the centroid of a spherical triangle from its vertices;
        
 
        - 
          
          stri_vertices_to_orientation.m, 
          attempts to define an orientation for a spherical triangle 
          from its vertices;
        
 
        - 
          
          stri_vertices_to_sides.m, 
          computes the sides of a spherical triangle from its sides;
        
 
        - 
          
          triangulation_neighhbor_triangles.m, 
          determines triangle neighbors in a triangulation;
        
 
        - 
          
          uniform_on_sphere01_map.m, 
          returns uniform random points on the unit sphere.
        
 
        - 
          
          voronoi_areas.m, 
          determines the area of each Voronoi polygon, given the
          Delaunay triangulation of points on the unit sphere.
        
 
        - 
          
          voronoi_areas_direct.m, 
          determines the area of each Voronoi polygon, given the
          Delaunay triangulation of points on the unit sphere and
          the location of the Voronoi vertices.
        
 
        - 
          
          voronoi_centroids.m, 
          determines the centroid of each Voronoi polygon, given the
          Delaunay triangulation of points on the unit sphere.
        
 
        - 
          
          voronoi_order.m, 
          determines the order of each Voronoi polygon, given the
          Delaunay triangulation of points on the unit sphere.
        
 
        - 
          
          voronoi_polygons.m, 
          determines the Voronoi polygons, given the
          Delaunay triangulation of points on the unit sphere.
        
 
        - 
          
          voronoi_vertices.m, 
          determines the location of Voronoi vertices, given the
          Delaunay triangulation of points on the unit sphere.
        
 
      
    
    
    
      Last revised on 10 May 2023.