jeudi 11 mai 2017

Randomly generate points with similar spacing

I want to generate x amount of points that are all spaced evenly while still maintaining randomness. The randomly generated points will be displayed on a rectangular canvas. At the moment I'm simply generating each point with Math.random(). I've tried testing the spacing for each point in relation to the others but I don't know how to make this work with x amount of points.

How should I go about generating these points?




Aucun commentaire:

Enregistrer un commentaire