voronoi2d: Computes the voronoi tesselation of a set of 2D points.

Description Usage Arguments Value Examples

View source: R/polygon.R

Description

Uses the package deldir to compute the voronoi tesselation of a set of points.

Usage

1
  voronoi2d(x, y, xb = NULL, yb = NULL)

Arguments

x

X coordinates of the points

y

Y coordinates of the points

xb

X limits of outer box of the tesselation

yb

Y limits of outer box of the tesselation

Value

A list of polygons corresponding to the voronoi regions of each node.

Examples

1
2
3
4
5
x <- runif(10)
y <- runif(10)
vor <- voronoi2d(x, y, c(0, 1), c(0, 1))
plot(x, y, ty='p', xlim=c(-.1, 1.1), ylim=c(-.1, 1.1))
for (p in vor) polygon(v[1,], v[2,])

tunelipt/model3d documentation built on Nov. 5, 2019, 10:59 a.m.