flash on 2012-1-22
package {
import flash.events.Event;
import flash.display.Sprite;
[SWF(frameRate="60")]
public class FlashTest extends Sprite {
private const w:Number=465;
private const h:Number=465;
private const s:Number=50;
private var a:Number;
public function FlashTest() {
a=0;
graphics.lineStyle(0,0x000000);
graphics.moveTo(0,0);
addEventListener(Event.ENTER_FRAME,onEnterFrame);
}
private function onEnterFrame(e:Event):void{
if(a>Math.PI*2){
removeEventListener(Event.ENTER_FRAME,onEnterFrame);
}
var t:Number=r(a);
if(a==0){
graphics.moveTo(w/2+t*Math.cos(a)*s,h/2+t*Math.sin(a)*s);
}
else{
graphics.lineTo(w/2+t*Math.cos(a)*s,h/2+t*Math.sin(a)*s);
}
a+=Math.PI/180;
}
private function r(a:Number):Number{
var t:Number=1;
for(var i:int=1;i<1000;i++){
t+=Math.cos(i*i*a)/i/i;
}
return t;
}
}
}