What is an elegant way to position 8 circles around a point
问题 var circles:Array = new Array(); for(var i:int = 0; i < 8; i++) { var ball:Ball = new Ball(); ball.x = ??? ball.y = ??? circles.push(ball); } What is the best way to position balls around some point lets say in 5-10 distance of each other, is there some formula? 回答1: for(var i:int = 0; i < 8; i++) { var ball:Ball = new Ball(); // Point has a useful static function for this, it takes two parameters // First, length, in other words how far from the center we want to be // Second, it wants the