タグ : ,

Math.atan, Math.atan2 : ActionScript2.0

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

Math.atan, Math.atan2の覚書。

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

arctan2.png

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。

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

関連記事

このページの上へ移動

コメント

Trackbacks

  1. [...] Math.atan, Math.atan2 : ActionScript | findxfine -世界中の素敵なWeb技術をご紹介- (tags: actionscript math) [...]

    ピンバック by links for 2008-06-10 « test — 2008年6月10日 @ 12:32 PM


コメントの投稿

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

 

 

 


トラックバックURL

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

このページの上へ