@@ -662,24 +662,25 @@ without any guarantee in quality. It's time to think out-of-the-box and luckily
662662enough, Robert Bridson did that for us and proposed a simple yet efficient
663663method:
664664
665- **Step 0 **. *Initialize an n-dimensional background grid for storing samples and
666- accelerating spatial searches. We pick the cell size to be bounded by :math:`\f rac{r}{\s qrt{n}}`, so
667- that each grid cell will contain at most one sample, and thus the grid can be
668- implemented as a simple n-dimensional array of integers: the default −1
669- indicates no sample, a non-negative integer gives the index of the sample
670- located in a cell. *
671-
672- **Step 1 **. *Select the initial sample, :math:`x_0`, randomly chosen uniformly from the
673- domain. Insert it into the background grid, and initialize the “active list”
674- (an array of sample indices) with this index (zero). *
675-
676- **Step 2 **. *While the active list is not empty, choose a random index from it
677- (say :math:`i`). Generate up to :math:`k` points chosen uniformly from the spherical annulus
678- between radius :math:`r` and :math:`2r` around :math:`x_i`. For each point in turn, check if it is
679- within distance :math:`r` of existing samples (using the background grid to only test
680- nearby samples). If a point is adequately far from existing samples, emit it
681- as the next sample and add it to the active list. If after :math:`k` attempts no such
682- point is found, instead remove :math:`i` from the active list. *
665+ **Step 0 **. Initialize an n-dimensional background grid for storing samples and
666+ accelerating spatial searches. We pick the cell size to be bounded by
667+ :math: `\frac {r}{\sqrt {n}}`, so that each grid cell will contain at most one
668+ sample, and thus the grid can be implemented as a simple n-dimensional array of
669+ integers: the default −1 indicates no sample, a non-negative integer gives the
670+ index of the sample located in a cell.
671+
672+ **Step 1 **. Select the initial sample, :math: `x_0 `, randomly chosen uniformly from the
673+ domain. Insert it into the background grid, and initialize the “active list”
674+ (an array of sample indices) with this index (zero).
675+
676+ **Step 2 **. While the active list is not empty, choose a random index from
677+ it (say :math: `i`). Generate up to :math: `k` points chosen uniformly from the
678+ spherical annulus between radius :math: `r` and :math: `2 r` around
679+ :math: `x_i`. For each point in turn, check if it is within distance :math: `r`
680+ of existing samples (using the background grid to only test nearby
681+ samples). If a point is adequately far from existing samples, emit it as the
682+ next sample and add it to the active list. If after :math: `k` attempts no
683+ such point is found, instead remove :math: `i` from the active list.
683684
684685
685686Implementation poses no real problem and is left as an exercise for the
0 commit comments