javascript - Placing a circle so that it does not collide with any other circles -


given canvas bunch of circles radius, 50, how place circle radius 10 in random location not collide or overlap existing circles?

i know can place circle , check if there collisions , retry, need place lot of circles , stuck. wondering if there better ways solves this.

the solution going use create image same size , render every circle onto image new radius equals existing circles radius plus 1 want to place. every pixel free of circle possible location , can pick locations.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -