0% found this document useful (0 votes)
19 views1 page

Fisher-Yates: Poisson Disc Distribution

This document discusses two algorithms: Poisson disc distribution, which samples random points while maintaining a minimum distance between points, and Fisher–Yates shuffling, which randomly shuffles the elements of an array. It also includes some sample output values and a hexadecimal number.

Uploaded by

Alina Aldea
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views1 page

Fisher-Yates: Poisson Disc Distribution

This document discusses two algorithms: Poisson disc distribution, which samples random points while maintaining a minimum distance between points, and Fisher–Yates shuffling, which randomly shuffles the elements of an array. It also includes some sample output values and a hexadecimal number.

Uploaded by

Alina Aldea
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Poisson disc distribution

function sample() {
var bestCandidate, bestDistance = 0;
for (var i = 0; i < numCandidates; ++i) {
var c = [Math.random() * width, Math.random() * height],
d = distance(findClosest(samples, c), c);
if (d > bestDistance) {
bestDistance = d;
bestCandidate = c;
}
}
return bestCandidate;
}

Shuffling - FisherYates
function shuffle(array) {
var n = array.length, t, i;
while (n) {
i = Math.random() * n-- | 0; // 0 i < n
t = array[n];
array[n] = array[i];
array[i] = t;
}
return array;
}

-221.72, -324.46, 22.47, 0.00

0x971c93421 big screens script

You might also like