### Recent Posts

### Archives

### Categories

Advertisements

November 9, 2010

Posted by on

Found this sketch of Albrecht Duerer on Citrinitas and I had to do it. It was obvious that there was some trigonemetry involved, especially in the left hand side. The one with the circles look like a sine wave, oscillating on the vertical axis. from what I gather,

-each step the cos(angle) gets incremented.

-circle’s horizontal positions are cos(anle).

-since cos(x) goes from -1 to 1, we get the wave plotted.

for(var j:Number = 0;j<=600;j++){

var dot:Sprite = new Sprite();

dot.graphics.lineStyle(1,0×000000,1);

dot.graphics.drawCircle(0,0,4);

dot.x=Math.sin(angle*(Math.PI/180))*40+100;

dot.y=j*2+2;

addChild(dot); angle+= j/20; trace(600-j);

}

Above is the AS3.0 code of the algorithm. Also, Flash you need to convert degrees to radians.

Advertisements

%d bloggers like this:

## Recent Comments