In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

くるくる sinH

双曲線正弦関数
回転で配列して回してみた
せまってくるよ
参考・・・http://ja.wikipedia.org/wiki/双曲線関数
Get Adobe Flash player
by 178ep3 16 Jun 2009
    Embed
/**
 * Copyright 178ep3 ( http://wonderfl.net/user/178ep3 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/qBRG
 */

//		双曲線正弦関数
//		回転で配列して回してみた
//		せまってくるよ
//		参考・・・http://ja.wikipedia.org/wiki/双曲線関数

package
{
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.events.Event;

	public class rotationSinH extends Sprite
	{
		public function rotationSinH()
		{
			var _stg:Sprite = addChild(new Sprite())as  Sprite;
			_stg.x = _stg.y = 233;
			for(var i:uint=0; i<360; i+=5)
			{
				var a:SINH = _stg.addChild(new SINH())as SINH;
				a.rotation = i;
			}
			
			var addScale:Number = 0.01;
			
			function loop(e:Event):void
			{
				_stg.rotation += 7;
				_stg.scaleX += addScale;
				_stg.scaleY += addScale;
				
				if(_stg.scaleX >20 || _stg.scaleX <1)addScale *= -1;
				
			}
			addEventListener(Event.ENTER_FRAME,loop);
		}
	}
}
	import flash.display.Shape;

class SINH extends Shape
{
	public function SINH()
	{
		var P:uint = 10;
		var step:Number=0.1;
		var _my:Number = sihH(-5);
		
		for(var i:Number=-5; i<5; i+=step)
		{
			var s:Number = sihH(i);
			this.graphics.lineStyle(1,0x00);
			this.graphics.moveTo((i-step)*P,_my*P);
			this.graphics.lineTo(i*P,s*P);
			this.graphics.endFill();
			_my = s;
		}
	}
	
	private function sihH(num:Number):Number
	{
		return (Math.exp(num)-Math.exp(-num))/2;
	}
}