# random points in a square
set.seed(314)
library(tessellation)
library(uniformly)
square <- rbind(
c(-1, 1), c(1, 1), c(1, -1), c(-1, -1)
)
ptsin <- runif_in_cube(10L, d = 2L)
pts <- rbind(square, ptsin)
d <- delaunay(pts)
opar <- par(mar = c(0, 0, 0, 0))
plotDelaunay2D(
d, xlab = NA, ylab = NA, asp = 1, color = "random",
randomArgs = list(hue = "random", luminosity = "dark")
)
par(opar)
Run the code above in your browser using DataLab