Graphic of Sin
package {
import flash.geom.Point;
import flash.display.Sprite;
public class FlashTest extends Sprite {
private var amplitude:Number = 0.5;
private var frequency:uint = 10;
private var halfStageWidth:Number = 0;
public function FlashTest():void {
halfStageWidth = stage.stageWidth * 0.5;
this.graphics.lineStyle(1,0xffffff,0.2);
this.graphics.beginFill(0x000000);
this.graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);
this.graphics.endFill();
this.graphics.moveTo(0, stage.stageHeight * 0.5);
this.graphics.lineTo(stage.stageWidth,stage.stageHeight * 0.5);
this.graphics.moveTo(stage.stageWidth * 0.5 , 0);
this.graphics.lineTo(stage.stageWidth*0.5 , stage.stageHeight);
var startPoint:Point = new Point(stage.stageWidth * 0.5 ,stage.stageHeight * 0.5);
this.graphics.lineStyle(1,0xffffff,1);
this.graphics.moveTo(startPoint.x,startPoint.y);
for(var iter:Number = 0 ; iter < halfStageWidth; iter++){
var destPoint:Point = new Point(startPoint.x + iter ,startPoint.y + (halfStageWidth - iter) * amplitude * Math.sin(iter / frequency));
this.graphics.lineTo(destPoint.x, destPoint.y);
}
}
}
}