三角関数 八の字運動 : ActionScript
三角関数を用いた八の字(?)運動のサンプルを作成しました。
赤字の部分が三角関数 極座標/媒介変数表示された円運動 : 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);
関連記事
- 三角関数 座標変換を用いた円運動 : ActionScript
- 三角関数 極座標/媒介変数表示された円運動: ActionScript
- 双曲螺旋 : ActionScript
- 三角関数(回転行列を用いた円運動) : ActionScript2.0
- 三角関数 極座標/媒介変数表示した楕円運動: ActionScript
コメント
コメントはまだありません。
コメントの投稿
改行と段落タグは自動で挿入されます。
メールアドレスは表示されません。
トラックバックURL
http://www.findxfine.com/flash/actionscript/88.html/trackback