Posts Tagged ‘Random’

ode to soup

Thursday, March 19th, 2009

oh little potatoe, stranded on a crouton island amidst an ocean of soup. If you knew how much time you had left you might do more than sit there.

Ribbon evolution

Thursday, March 19th, 2009

so heres the next step in my ribon madness

multi ribbons and some nearly satisfactory motion. i was aiming for smooth elipses but got something not un pleasing, I did mention i need to learn a lot more math.

multi ribbons
Example: ribbons21
multi ribbons

 

Flash Math Art

Monday, March 9th, 2009

Some flash math art based on stuff i found, i’ll put links up soon to the original source.

 heres the example. if it does nothing after a few seconds reload it. part of the beauty of random math art is it may be doing something absolutely beautifull on such a small scale only it knows its happening

:)

 flashmath

 

b00000002
And the code.

[SWF(width=400, height=400)]
var numA:Number = new Number(Math.random()* 2000);
var numB:Number = new Number(Math.random()* 2000);
var numC:Number = new Number(Math.random()* 1000);
var shape:Shape = new Shape();
var bmpd:BitmapData = new BitmapData(400, 400, false, 0xffffff);
var bmp:Bitmap = addChild(new Bitmap(bmpd)) as Bitmap;
var r:Number = numC;
bmp.width = bmp.height = 400;

var points:Array = new Array();
var minDist:Number = 400;
var a0:Number = 0;
var a1:Number = 0;
var v0:Number = Math.random() * .2;
var v1:Number = Math.random() * .2;

addEventListener(Event.ENTER_FRAME, tick);

function tick(event:Event):void
{
	var p:Point = new Point(r + Math.cos(a0) * r, r + Math.sin(a1) * r);
	points.push(p);
	draw();
	a0 += v0;
	a1 += v1;
}

function draw():void
{
	var p0:Point = points[points.length - 1] as Point;
	for(var i:int = 0; i < points.length - 1; i++)
	{
		var p1:Point = points[i] as Point;
		var dx:Number = p0.x - p1.x;
		var dy:Number = p0.y - p1.y;
		var dist:Number = Math.sqrt(dx * dx + dy * dy);
		if(dist < minDist)
		{
			shape.graphics.clear();
			shape.graphics.lineStyle(0, 0, (1 - dist / minDist) * .8);
			shape.graphics.moveTo(p0.x, p0.y);
			shape.graphics.lineTo(p1.x, p1.y);
			bmpd.draw(shape);
		}
	}
}
 here it is, where i got this from.

http://www.bit-101.com/blog/?p=1997