Circles division in JavaScript and HTML5 Canvas