タグ : ,

三角関数 八の字運動 : ActionScript

投稿日 : 2008年2月17日 | 更新日 : 2010年12月11日 前のページへ戻る

三角関数を用いた八の字(?)運動のサンプルを作成しました。

赤字の部分が三角関数 極座標/媒介変数表示された円運動 : ActionScriptから変更された部分です。

// クリップ作成オブジェクト
function CreateClip(degree,radius,centerX,centerY) {
 // 度数
 this.degree = degree;
 // 半径
 this.radius = radius;
 // 円中心
 this.centerX  = centerX,
 this.centerY  = centerY,

 this.onEnterFrame = function(){
 	// 弧度
 	var radian = Math.PI/180*this.degree;
 	// 位置
 	this._x = this.centerX +this.radius*Math.cos(radian);
 	this._y = this.centerY +this.radius*Math.sin(radian + radian);
 	this.degree += 5;
 }
}
// 角度,半径,中心のX座標,Y座標
var clip = new CircleClip(0,100,150,150);
attachMovie('clip','clip',0,clip);

ActionScript2.0 | 固定リンク | Comments (0)

関連記事

このページの上へ移動

コメント

コメントはまだありません。

コメントの投稿

改行と段落タグは自動で挿入されます。
メールアドレスは表示されません。

 

 

 


トラックバックURL

http://www.findxfine.com/flash/actionscript/88.html/trackback

このページの上へ