Difference between revisions of "Voronoisphere.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Normalise sequential blank lines)
(sync with Spinach main f053e432: res argument removed, exact Delaunay-dual construction documented)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:voronoisphere.m}} __NOTOC__
 
{{DISPLAYTITLE:voronoisphere.m}} __NOTOC__
−
Voronoi tessellation on a sphere.
+
Voronoi tessellation of the unit sphere around the specified points, computed as the exact geometric dual of the Delaunay triangulation returned by the convex hull.
  
 
==Syntax==
 
==Syntax==
  
−
     [vertices,indices,polygons,sangles]=voronoisphere(xyz,res)
+
     [vertices,indices,polygons,sangles]=voronoisphere(xyz)
  
−
==Arguments==
+
==Parameters==
  
 
     xyz      - (3 x n) array, coordinates of n distinct vectors
 
     xyz      - (3 x n) array, coordinates of n distinct vectors
−
                in R^3; these will be normalised
+
                in R^3; these will be normalised
−
 
−
    res      - polygon edges longer than this resolution will
 
−
                have extra points added so that spherical plots
 
−
                look neat (optional, default is pi/180)
 
  
 
==Outputs==
 
==Outputs==
  
 
     vertices - (3 x m) array, coordinates of the vertices of the
 
     vertices - (3 x m) array, coordinates of the vertices of the
−
                Voronoi tessellation
+
                Voronoi tessellation
 
   
 
   
 
     indices  - (n x 1) cell array, j-th element contains the in-
 
     indices  - (n x 1) cell array, j-th element contains the in-
−
                dices of the Voronoi cell vertices that corres-
+
                dices of the Voronoi cell vertices that correspond
−
                pond to xyz(:,j). Vertices are oriented counter-
+
                to xyz(:,j). Vertices are oriented counterclockwise
−
                clockwise when looking from outside.
+
                when looking from outside.
 
   
 
   
−
     polygons - (n x 1) cell array, j-th element contains the dis-
+
     polygons - (n x 1) cell array, j-th element contains the coor-
−
                cretised spherical polygonal coordinates of the
+
                dinates of the vertices of the j-th Voronoi cell,
−
                vertices of the j-th Voronoi cell.
+
                in the same counterclockwise order
 
   
 
   
 
     sangles  - (n x 1) array, solid angles of each Voronoi cell
 
     sangles  - (n x 1) array, solid angles of each Voronoi cell
 +
 +
==Notes==
 +
Every Voronoi vertex is the circumcentre of a Delaunay triangle, placed on the side of the triangle plane that the convex hull property guarantees to be empty; every Voronoi cell is geodesically convex and therefore star-shaped around its generator point, which makes the angular sort used here an exact construction rather than a heuristic.
  
 
==Examples==
 
==Examples==
Line 37: Line 36:
  
 
==See also==
 
==See also==
−
[[Kernel_utilities#Integration_grids|Integration grids]], [[Appendix I: powder grids]]
+
[[arclength.m]], [[gaussleg.m]], [[get_hull.m]], [[grid_fibon.m]], [[grid_igloo.m]], [[grid_kron.m]], [[grid_plot.m]], [[grid_polar.m]], [[grid_test.m]], [[grid_trian.m]], [[one_vcell_solidangle.m]], [[repulsion.m]], [[shrewd.m]], [[sphtarea.m]], [[sphtrsubd.m]], [[vcell_solidangle.m]], [[voitlander.m]], [[zfs_sampling.m]], [[Kernel_utilities]], [[Appendix I: powder grids]]
  
 
''Version 2.6, authors: [[Ilya Kuprov]]''
 
''Version 2.6, authors: [[Ilya Kuprov]]''

Latest revision as of 07:47, 30 August 2026

Voronoi tessellation of the unit sphere around the specified points, computed as the exact geometric dual of the Delaunay triangulation returned by the convex hull.

Syntax

    [vertices,indices,polygons,sangles]=voronoisphere(xyz)

Parameters

    xyz      - (3 x n) array, coordinates of n distinct vectors
               in R^3; these will be normalised

Outputs

    vertices - (3 x m) array, coordinates of the vertices of the
               Voronoi tessellation

    indices  - (n x 1) cell array, j-th element contains the in-
               dices of the Voronoi cell vertices that correspond
               to xyz(:,j). Vertices are oriented counterclockwise
               when looking from outside.

    polygons - (n x 1) cell array, j-th element contains the coor-
               dinates of the vertices of the j-th Voronoi cell,
               in the same counterclockwise order

    sangles  - (n x 1) array, solid angles of each Voronoi cell

Notes

Every Voronoi vertex is the circumcentre of a Delaunay triangle, placed on the side of the triangle plane that the convex hull property guarantees to be empty; every Voronoi cell is geodesically convex and therefore star-shaped around its generator point, which makes the angular sort used here an exact construction rather than a heuristic.

Examples

The output of fundamentals/quadratures/grid_diagrams.m file in the Spinach example set is given below. The solid lines are edges of Voronoi polyhedra computed using this function.

Voronoi example.png

See also

arclength.m, gaussleg.m, get_hull.m, grid_fibon.m, grid_igloo.m, grid_kron.m, grid_plot.m, grid_polar.m, grid_test.m, grid_trian.m, one_vcell_solidangle.m, repulsion.m, shrewd.m, sphtarea.m, sphtrsubd.m, vcell_solidangle.m, voitlander.m, zfs_sampling.m, Kernel_utilities, Appendix I: powder grids

Version 2.6, authors: Ilya Kuprov