双曲螺旋の覚書です。
/*
螺旋運動2 : 双曲螺旋
r = a/θ (サンプルではa = 200)
*/
// クリップ作成オブジェクト
function SpiralClip(degree, centerX, centerY) {
/* プロパティ */
// 度数
var degree = degree;
// 円中心
var centerX = centerX;
var centerY = centerY;
/* onEnterFrame */
this.onEnterFrame = function() {
// 弧度
var radian = Math.PI/180*degree;
// 位置
this._x = centerX+200*Math.cos(radian)/radian;
this._y = centerY+200*Math.sin(radian)/radian;
if (degree<2160) {
degree += 5;
}
};
}
// 角度,半径,中心のX座標,Y座標 */
var o = new SpiralClip(0, 100, 100);
attachMovie('clip', 'clip', 0, o);
No comments yet.
改行と段落タグは自動で挿入されます。
メールアドレスは表示されません。