wstomv
wstomv

Reputation: 891

Online algorithms to generate evenly distributed points in the unit square

I am looking for online algorithms to generate points that are reasonably uniformly distributed in the unit square.

Generating such points in the unit interval can be done by using the golden ratio Phi:

How to do that in 2D?

If the number of points is known in advance to be N, then ((Phi * i) mod 1, i/N) works nicely. But that is not online.

For some c, the points ((Phi * i) mod 1, (c * i) mod 1) could work, but it is not clear which c is best. Especially, for larger numbers of points, all c that I tried had clear deficiencies.

Upvotes: 2

Views: 799

Answers (1)

David Eisenstat
David Eisenstat

Reputation: 65458

Martin Roberts (The Unreasonable Effectiveness of Quasirandom Sequences, 2018) recommends multiples of (1/φ2, 1/φ22) where φ2 = cbrt((9 + sqrt(69))/18) + cbrt((9 − sqrt(69))/18) is the plastic number.

Upvotes: 4

Related Questions