mal-math
C++20 mathematics library.
All Classes Namespaces Files Functions Variables Typedefs Concepts
mal_math::random::poisson_disc Namespace Reference

Namespaces

namespace  _detail
 

Functions

std::vector< vec2Generate (std::mt19937 &gen, vec2 const &from, vec2 const &to, float min_distance, size_t max_attempts=30) noexcept
 Wrapper function for generating Poisson Disk sampled 2D points.
 

Function Documentation

◆ Generate()

std::vector< vec2 > mal_math::random::poisson_disc::Generate ( std::mt19937 & gen,
vec2 const & from,
vec2 const & to,
float min_distance,
size_t max_attempts = 30 )
inlinenoexcept

Wrapper function for generating Poisson Disk sampled 2D points.

Parameters
genReference to a random number generator.
fromStart vector.
toEnd vector.
min_distanceMinimum distance between points.
max_attemptsMaximum number of attempts before giving up on finding a new point.
Returns
A vector containing the generated points.

Definition at line 206 of file random.hpp.

Here is the call graph for this function: