Math.atan, Math.atan2 : ActionScript2.0
Math.atan, Math.atan2の覚書。
ActionScriptの逆正接関数(アークタンジェント)はMath.atan,Math.atan2の2つがある。

ActionScriptのY座標は下向きが正。
Math.atan()の引数は三角比。上の図では例えば(x/y)。
-x/-y = x/yなのでMath.atanは同じ値(θ)を返す。
一方、Math.atan2は引数を二つとり、Math.atan2(y, x)はθを、Math.atan2(-y,-x)はθ’を返す。引数の順番に注意。
atanの戻り値は-π/2 ~ π/2。
関連記事
- ActionScriptと三角関数 : ActionScript2.0
- 三角関数 極座標/媒介変数表示された円運動: ActionScript
- 度数 ⇔ 弧度 : ActionScript
- 三角関数を利用した揺れ1 : ActionScript
- 三角関数(回転行列を用いた円運動) : ActionScript2.0
コメント
Trackbacks
-
[...] Math.atan, Math.atan2 : ActionScript | findxfine -世界中の素敵なWeb技術をご紹介- (tags: actionscript math) [...]
コメントの投稿
改行と段落タグは自動で挿入されます。
メールアドレスは表示されません。
トラックバックURL
http://www.findxfine.com/flash/actionscript/347.html/trackback