ButterflyCurve
http://mathworld.wolfram.com/ButterflyCurve.html
♥0 |
Line 9 |
Modified 2010-12-10 15:25:32 |
MIT License
archived:2017-03-20 12:43:43
ActionScript3 source code
/**
* Copyright 12346 ( http://wonderfl.net/user/12346 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/3RKt
*/
//http://mathworld.wolfram.com/ButterflyCurve.html
package{[SWF(frameRate=180)]public class g extends Sprite{
public var t:Number=0,C:Shape=new Shape,R:Graphics=C.graphics
public function g(){addChild(C).x=C.y=232;R.lineStyle(0),R.moveTo(f(0),0)
addEventListener("enterFrame",function():void{
var r:Number=f(t+=1/128);R.lineTo(r*Math.cos(t),r*Math.sin(t))
})}
public function f(t:Number):Number{return 64*(
Math.pow(2.71828182845905,Math.cos(t))-2*Math.cos(4*t)+Math.pow(Math.sin(t/12),5)
)}}import flash.display.*}