var PlaceOnEllipse = function (items, ellipse, startAngle, endAngle) { if (startAngle === undefined) { startAngle = 0; } if (endAngle === undefined) { endAngle = 6.28; } var angle = startAngle; var angleStep = (endAngle - startAngle) / items.length; var a = ellipse.width / 2; var b = ellipse.height / 2; for (var i = 0; i < items.length; i++) { items[i].x = ellipse.x + a * Math.cos(angle); items[i].y = ellipse.y + b * Math.sin(angle); angle += angleStep; } return items; }; module.exports = PlaceOnEllipse;