Deldir.deldirFunction

deldir(x::Vector, y::Vector; ...)

Compute the Delaunay triangulation and Voronoi tesselation of the 2D points with x-coordinates x and y-coordinates y.

Optional arguments are

  • rw: Boundary rectangle specified as a vector with [xmin, xmax, ymin, ymax]. By default, rw is the unit rectangle.
  • epsilon: A value of epsilon used in testing whether a quantity is zeros, mainly in the context of whether points are collinear.

If anomalous errors arise, it is possible that these may averted by adjusting the value of epsilon upward or downward. By default, epsilon = 1e-9.

The output are three DataFrames:

delsgs

  • The x1, y1, x2 & y2 entires are the coordinates of the points joined by an edge of a Delaunay triangle.
  • The ind1 and ind2 entries are the indices of the two points which are joined.

vorsgs

  • The x1, y1, x2 & y2 entires are the coordinates of the endpoints of one the edges of a Voronoi cell.
  • The ind1 and ind2 entries are the indices of the two points, in the set being triangulated, which are separated by that edge
  • The bp1 entry indicates whether the first endpoint of the corresponding edge of a Voronoi cell is a boundary point (a point on the boundary of the rectangular window).

Likewise for the bp2 entry and the second endpoint of the edge.

  • The thirdv1 and thirdv2 columns are the indices of the respective third vertices of the Delaunay triangle whose circumcentres constitute the corresponding endpoints of the edge under consideration.

summary

  • The x and y entries of each row are the coordinates of the points in the set being triangulated.
  • The ntri entry are the number of Delaunay triangles emanating from the point.
  • The del_area entry is 1/3 of the total area of all the Delaunay triangles emanating from the point.
  • The n_tside entry is the number of sides — within the rectangular window — of the Voronoi cell surrounding the point.
  • The nbpt entry is the number of points in which the Voronoi cell intersects the boundary of the rectangular window.
  • The vor_area entry is the area of the Voronoi cell surrounding the point.
Deldir.deldirwrapper!Method

deldirwrapper!(da::DeldirArguments)

Wrapper for the Fortran code that returns the output undigested.

Deldir.edgesMethod
edges(D) -> Vector, Vector

Collect the edges of a dataframe in vectors that are ready to be plotted.

Deldir.remove_duplicatesMethod
remove_duplicates(x::Vector, y::Vector)

Remove duplicate tuples (x[i],y[i]) from the vectors x and y.

Deldir.voronoiareaFunction
voronoiarea(x::Vector, y::Vector, rw) -> Vector

Compute the area of each Voronoi cell of the generators (x[i], y[i]) in the vectors x and y.

rw is the boundary window.