I'm trying to place six circles around a center circle. Eeach of them has the same diameter so it should be possible to place them around the center without space between or overlaps. I thinking to be close to the solution but there are small overlaps. I can't find an answer how to get a perfect calculation.
Thats my current result:
and this the way how I've calculated it:
this.distribute = function () {
var surfaceSize = this.surface.getAbsoluteSize(),
i,
x = 0,
y = 0;
// 7 CIRCLES 6 AFFECTED
for (i = 0; i < this.config.length; i += 1) {
var oBall = this.getBall(i);
if (i > 0) {
x = oBall.config.size.width * Math.sin(i);
y = oBall.config.size.height * Math.cos(i);
}
oBall.node.setPosition(x, y, 0);
}
};
Thanks in advance