poisson_disc: Poisson disc sampling

Description Usage Arguments Value Examples

View source: R/poisson_disc.R

Description

Generates a set of (x, y) points that are never closer than some minimum distance in a canvas of given width and height.

Usage

1
poisson_disc(width, height, min_dist, k = 30)

Arguments

width

The canvas width (numeric)

height

The canvas height (numeric)

min_dist

The minimum distance between points (numeric)

k

Samples to choose before rejection (numeric), this should usually stay at 30

Value

A data frame with the x and y coordinates of the points.

Examples

1
2
#generate a set of points within a 400x400 canvas with a minimum distance of 20
pts <- poisson_disc(400, 400, 20)

will-r-chase/poissondisc documentation built on Nov. 6, 2019, 5:28 p.m.