1.0 random distribution
"basics in generative art" is a series of articles available here:http://en.nicoptere.net/?p=1180
/**
* Copyright nicoptere ( http://wonderfl.net/user/nicoptere )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/orjP
*/
package
{
import flash.geom.Point;
import flash.geom.Rectangle;
/**
* @author Nicolas Barradeau
* http://en.nicoptere.net
*/
public class RandomDistribution
{
static public function distribute( rect:Rectangle, count:int = 100 ):Vector.<Point>
{
var points:Vector.<Point> = new Vector.<Point>();
var i:int = count;
while( i-- )
{
points.push( new Point( rect.x + Math.random() * rect.width, rect.y + Math.random() * rect.height ) );
}
return points;
}
}
}