Function poisson::calc_radius [] [src]

pub fn calc_radius(points: u32, relative_radius: f64) -> f64

Calculates approximately needed radius from amount of points wanted and relative radius specified. Points should be larger than 0. Relative radius should be ]0, 1].

Example

extern crate rand;
extern crate poisson;

let radius = poisson::calc_radius(100, 0.8);
let mut poisson = poisson::PoissonDisk::new(rand::weak_rng(), radius);
let mut vecs = vec![];
poisson.create(&mut vecs);
println!("{:?}", vecs);