Difference between revisions of "Voronoisphere.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Created page with "{{DISPLAYTITLE:function.m}} __NOTOC__ Voronoi tessellation on a sphere. ==Syntax== [vertices,indices,polygons,sangles]=voronoisphere(xyz,res) ==Arguments== xyz...")
 
(See also)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:function.m}} __NOTOC__
+
{{DISPLAYTITLE:voronoisphere.m}} __NOTOC__
 
Voronoi tessellation on a sphere.
 
Voronoi tessellation on a sphere.
  
Line 34: Line 34:
 
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.
 
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.
  
[File:voronoi_example.png]
+
[[File:voronoi_example.png]]
  
 
==See also==
 
==See also==
[[Kernel_utilities#Integration_grids|Kernel grid utilities]], [[Appendix_I:_powder_grids|Powder grids]]
+
[[Kernel_utilities#Integration_grids|Integration grids]], [[Appendix I: powder grids]]
  
  
 
''Version 2.6, authors: [[Ilya Kuprov]]''
 
''Version 2.6, authors: [[Ilya Kuprov]]''

Latest revision as of 19:56, 29 June 2021

Voronoi tessellation on a sphere.

Syntax

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

Arguments

    xyz      - (3 x n) array, coordinates of n distinct vectors
                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

    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 corres-
                pond to xyz(:,j). Vertices are oriented counter-
                clockwise when looking from outside.

    polygons - (n x 1) cell array, j-th element contains the dis-
                cretised spherical polygonal coordinates of the
                vertices of the j-th Voronoi cell.

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

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

Integration grids, Appendix I: powder grids


Version 2.6, authors: Ilya Kuprov